You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.AreEqual(expectedCount,actualCount,$"Mismatch between number of diagnostics returned, expected \"{expectedCount}\" actual \"{actualCount}\"\r\n\r\nDiagnostics:\r\n{(actualResults.Any()?FormatDiagnostics(analyzer,actualResults.ToArray()):"NONE.")}\r\n");
108
+
Assert.AreEqual(expectedCount,actualCount,$"Mismatch between number of diagnostics returned, expected \"{expectedCount}\" actual \"{actualCount}\"{Environment.NewLine }{Environment.NewLine }Diagnostics:{Environment.NewLine }{(actualResults.Any()?FormatDiagnostics(analyzer,actualResults.ToArray()):"NONE.")}{Environment.NewLine }");
string.Format($"Expected:\nA project diagnostic with No location\nActual:\n{FormatDiagnostics(analyzer,actual)}"));
119
+
string.Format($"Expected:{Environment.NewLine }A project diagnostic with No location{Environment.NewLine }Actual:{Environment.NewLine }{FormatDiagnostics(analyzer,actual)}"));
$"Expected {expected.Locations.Length-1} additional locations but got {additionalLocations.Length} for Diagnostic:\r\n{FormatDiagnostics(analyzer,actual)}\r\n");
128
+
$"Expected {expected.Locations.Length-1} additional locations but got {additionalLocations.Length} for Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,actual)}{Environment.NewLine }");
$"Expected diagnostic id to be \"{expected.Id}\" was \"{actual.Id}\"\r\n\r\nDiagnostic:\r\n{FormatDiagnostics(analyzer,actual)}\r\n");
137
+
$"Expected diagnostic id to be \"{expected.Id}\" was \"{actual.Id}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,actual)}{Environment.NewLine }");
150
138
151
139
Assert.AreEqual(actual.Severity,
152
140
expected.Severity,
153
-
$"Expected diagnostic severity to be \"{expected.Severity}\" was \"{actual.Severity}\"\r\n\r\nDiagnostic:\r\n{FormatDiagnostics(analyzer,actual)}\r\n");
141
+
$"Expected diagnostic severity to be \"{expected.Severity}\" was \"{actual.Severity}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,actual)}{Environment.NewLine }");
154
142
155
143
Assert.AreEqual(actual.GetMessage(),
156
144
expected.Message,
157
-
"Expected diagnostic message to be \"{expected.Message}\" was \"{actual.GetMessage()}\"\r\n\r\nDiagnostic:\r\n{FormatDiagnostics(analyzer, actual)}\r\n");
145
+
$"Expected diagnostic message to be \"{expected.Message}\" was \"{actual.GetMessage()}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,actual)}{Environment.NewLine }");
$"Expected diagnostic to be in file \"{expected.Path}\" was actually in file \"{actualSpan.Path}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,diagnostic)}{Environment.NewLine }");
$"Expected diagnostic to be on line \"{expected.Line}\" was actually on line \"{actualLinePosition.Line+1}\"\r\n\r\nDiagnostic:\r\n{FormatDiagnostics(analyzer,diagnostic)}\r\n");
172
+
$"Expected diagnostic to be on line \"{expected.Line}\" was actually on line \"{actualLinePosition.Line+1}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,diagnostic)}{Environment.NewLine }");
186
173
}
187
174
188
175
// Only check column position if there is an actual column position in the real diagnostic
189
176
if(actualLinePosition.Character>0)
190
177
{
191
178
Assert.AreEqual(actualLinePosition.Character+1,
192
179
expected.Column,
193
-
"Expected diagnostic to start at column \"{expected.Column}\" was actually at column \"{actualLinePosition.Character + 1}\"\r\n\r\nDiagnostic:\r\n{FormatDiagnostics(analyzer, diagnostic)}\r\n");
180
+
$"Expected diagnostic to start at column \"{expected.Column}\" was actually at column \"{actualLinePosition.Character+1}\"{Environment.NewLine }{Environment.NewLine }Diagnostic:{Environment.NewLine }{FormatDiagnostics(analyzer,diagnostic)}{Environment.NewLine }");
0 commit comments