Base:
method
GetDiagnostics
Microsoft.CodeAnalysis.Compilation.GetDiagnostics(System.Threading.CancellationToken)
776 references to GetDiagnostics
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1564
Assert.Empty(compilation.
GetDiagnostics
().Where(diagnostic => diagnostic.Severity > DiagnosticSeverity.Hidden));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (18)
BreakingChanges.cs (1)
67
Assert.Equal(0, comp.
GetDiagnostics
().Count());
CodeGen\CodeGenOverridingAndHiding.cs (1)
3169
Assert.Equal(0, comp2.
GetDiagnostics
().Count());
CodeGen\CodeGenTupleTest.cs (3)
10956
Assert.Equal("7.0", Compilation.GetRequiredLanguageVersion(comp.
GetDiagnostics
()[1]));
10957
Assert.Equal("7.0", Compilation.GetRequiredLanguageVersion(comp.
GetDiagnostics
()[2]));
10958
Assert.Null(Compilation.GetRequiredLanguageVersion(comp.
GetDiagnostics
()[3]));
CodeGen\GotoTest.cs (6)
1130
compilation.
GetDiagnostics
().Verify(
1174
compilation.
GetDiagnostics
().Verify(
1180
compilation.
GetDiagnostics
().Verify(
1189
compilation.
GetDiagnostics
().Verify(
1202
compilation.
GetDiagnostics
().Verify(
1214
compilation.
GetDiagnostics
().Verify(
CodeGen\PatternTests.cs (5)
100
compilation.
GetDiagnostics
().Verify();
123
compilation.
GetDiagnostics
().Verify();
153
compilation.
GetDiagnostics
().Verify();
201
compilation.
GetDiagnostics
().Verify();
3316
compilation.
GetDiagnostics
().Verify(
Emit\CompilationEmitTests.cs (2)
2702
Assert.False(libComp.
GetDiagnostics
().Any());
2759
Assert.False(exeComp.
GetDiagnostics
().Any());
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
PDB\CSharpPDBTestBase.cs (1)
28
compilation.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
PDB\PDBUsingTests.cs (1)
1488
compilation.
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Info).Verify();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (143)
Attributes\AttributeTests.cs (3)
7865
compilation.
GetDiagnostics
();
7880
Assert.NotEmpty(compilation.
GetDiagnostics
());
8385
Assert.NotEmpty(compilation.
GetDiagnostics
());
Attributes\AttributeTests_Assembly.cs (22)
32
Assert.Empty(other.
GetDiagnostics
());
145
Assert.Empty(other.
GetDiagnostics
());
155
Assert.Empty(other.
GetDiagnostics
());
165
Assert.Empty(other.
GetDiagnostics
());
268
Assert.Empty(other.
GetDiagnostics
());
278
Assert.Empty(other.
GetDiagnostics
());
288
Assert.Empty(other.
GetDiagnostics
());
298
Assert.Empty(other.
GetDiagnostics
());
519
Assert.Empty(other.
GetDiagnostics
());
525
Assert.Empty(other.
GetDiagnostics
());
535
Assert.Empty(other.
GetDiagnostics
());
545
Assert.Empty(other.
GetDiagnostics
());
555
Assert.Empty(other.
GetDiagnostics
());
561
Assert.Empty(other.
GetDiagnostics
());
870
Assert.Empty(comp.
GetDiagnostics
());
893
Assert.Empty(comp.
GetDiagnostics
());
1081
var diagnostics = consoleappCompilation.
GetDiagnostics
();
1202
consoleappCompilation.
GetDiagnostics
().Verify();
1272
var diagnostics = consoleappCompilation.
GetDiagnostics
();
1375
var diagnostics = consoleappCompilation.
GetDiagnostics
();
1420
var diagnostics = compilation.
GetDiagnostics
();
2273
compilation.
GetDiagnostics
();
Attributes\AttributeTests_Security.cs (1)
1679
CreateCompilationWithMscorlib46(source).
GetDiagnostics
();
Attributes\AttributeTests_WellKnownAttributes.cs (16)
8295
var diags = comp.
GetDiagnostics
();
8328
var diags = comp.
GetDiagnostics
();
8359
var diags = comp.
GetDiagnostics
();
8390
var diags = comp.
GetDiagnostics
();
8430
var diags = comp.
GetDiagnostics
();
8461
var diags = comp.
GetDiagnostics
();
8498
var diags = comp.
GetDiagnostics
();
8706
var diags = comp2.
GetDiagnostics
();
8749
var diags = comp2.
GetDiagnostics
();
8849
var diags = comp2.
GetDiagnostics
();
8949
var diags = comp2.
GetDiagnostics
();
9132
var diags = comp2.
GetDiagnostics
();
9183
var diags = comp2.
GetDiagnostics
();
9324
var diags = comp.
GetDiagnostics
();
9462
var diags = comp.
GetDiagnostics
();
9511
var diags = comp2.
GetDiagnostics
();
Attributes\InternalsVisibleToAndStrongNameTests.cs (12)
184
Assert.Empty(comp.
GetDiagnostics
());
313
Assert.Empty(comp.
GetDiagnostics
());
359
Assert.Empty(comp.
GetDiagnostics
());
386
Assert.NotEmpty(other.
GetDiagnostics
());
399
var err = other.
GetDiagnostics
().Single();
839
Assert.Empty(c2.
GetDiagnostics
());
888
Assert.Empty(c2.
GetDiagnostics
());
921
Assert.Empty(requestor.
GetDiagnostics
());
1110
Assert.Empty(requestor.
GetDiagnostics
());
1275
Assert.Empty(requestor.
GetDiagnostics
());
1388
Assert.Empty(requestor.
GetDiagnostics
());
1611
var err = other.
GetDiagnostics
().Single();
Diagnostics\GetDiagnosticsTests.cs (6)
118
var diag = compilation.
GetDiagnostics
().Single();
434
var diagnostics = compilation.
GetDiagnostics
();
463
var diagnostics = compilation.
GetDiagnostics
();
514
var diagnostics = compilation.
GetDiagnostics
();
548
var compilerDiagnostics = compilation.
GetDiagnostics
();
1431
var compilationDiagnostics = compilation.
GetDiagnostics
();
FlowAnalysis\FlowDiagnosticTests.cs (1)
1874
var bindingDiags = comp.
GetDiagnostics
().ToArray();
Semantics\ExperimentalAttributeTests.cs (31)
65
var diag = comp.
GetDiagnostics
().Single();
120
foreach (var diag in comp.
GetDiagnostics
())
185
foreach (var diag in comp.
GetDiagnostics
())
294
foreach (var diag in comp.
GetDiagnostics
())
442
foreach (var diag in comp.
GetDiagnostics
())
512
foreach (var diag in comp.
GetDiagnostics
())
1072
var diag = comp.
GetDiagnostics
().Single();
1101
var diag = comp.
GetDiagnostics
().Single();
1132
var diag = comp.
GetDiagnostics
().Single();
1163
var diag = comp.
GetDiagnostics
().Single();
1194
var diag = comp.
GetDiagnostics
().Single();
1813
var diag = comp.
GetDiagnostics
().Single();
1854
var diag = comp.
GetDiagnostics
().Single();
1934
var diag = comp.
GetDiagnostics
().Single();
1975
var diag = comp.
GetDiagnostics
().Single();
2055
var diag = comp.
GetDiagnostics
().Single();
2120
var diag = comp.
GetDiagnostics
().Single();
2146
var diag = comp.
GetDiagnostics
().Single();
2172
var diag = comp.
GetDiagnostics
().Single();
2198
var diag = comp.
GetDiagnostics
().Single();
2224
var diag = comp.
GetDiagnostics
().Single();
2250
var diag = comp.
GetDiagnostics
().Single();
2276
var diag = comp.
GetDiagnostics
().Single();
2302
var diag = comp.
GetDiagnostics
().Single();
2328
var diag = comp.
GetDiagnostics
().Single();
2359
var diag = comp.
GetDiagnostics
().Single();
2390
var diag = comp.
GetDiagnostics
().Single();
2416
var diag = comp.
GetDiagnostics
().Single();
2442
var diag = comp.
GetDiagnostics
().Single();
2467
var diag = comp.
GetDiagnostics
().Single();
2492
var diag = comp.
GetDiagnostics
().Single();
Semantics\OutVarTests.cs (26)
20902
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21015
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21116
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21214
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21348
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21579
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21776
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
21978
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22129
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22224
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22391
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22558
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22652
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22766
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22857
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
22941
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
23002
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
31261
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
31434
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
33653
compilation.
GetDiagnostics
().Verify(
33761
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
33859
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
33958
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
34056
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
34141
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
34197
compilation.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_BadAttributeArgument).Verify(
Semantics\PatternMatchingTests.cs (1)
5055
CreateCompilation(program).
GetDiagnostics
();
Semantics\PatternMatchingTests_Scope.cs (18)
11789
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
11880
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
11975
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12067
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12189
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12409
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12600
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12799
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
12944
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13033
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13194
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13355
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13438
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13517
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13603
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13682
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13743
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
13918
compilation.
GetDiagnostics
().Where(d => !exclude.Contains(d.Code)).Verify(
Semantics\PatternSwitchTests.cs (6)
40
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
69
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
126
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
162
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
190
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
246
Assert.True(compilation.
GetDiagnostics
().HasAnyErrors());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (221)
Semantics\AccessCheckTests.cs (7)
985
Assert.Empty(other.
GetDiagnostics
());
995
Assert.Empty(c.
GetDiagnostics
());
1005
Assert.Empty(other.
GetDiagnostics
());
1038
Assert.Empty(c.
GetDiagnostics
());
1293
CreateCompilation(source).
GetDiagnostics
();
1320
CreateCompilation(source).
GetDiagnostics
();
1350
CreateCompilation(source).
GetDiagnostics
();
Semantics\AmbiguousOverrideTests.cs (1)
139
var diagnostics = comp.
GetDiagnostics
();
Semantics\BindingAsyncTasklikeTests.cs (1)
188
var diagnostics = compilation.
GetDiagnostics
();
Semantics\ForEachTests.cs (6)
1091
Assert.NotEmpty(CreateCompilation(source).
GetDiagnostics
());
1958
Assert.NotEmpty(compilation.
GetDiagnostics
());
1978
Assert.NotEmpty(compilation.
GetDiagnostics
());
1997
Assert.NotEmpty(compilation.
GetDiagnostics
());
2106
Assert.NotEmpty(CreateCompilation(source).
GetDiagnostics
());
2232
comp.
GetDiagnostics
();
Semantics\ForLoopErrorTests.cs (1)
200
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(),
Semantics\GlobalUsingDirectiveTests.cs (84)
887
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
890
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
893
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
896
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
958
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
961
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
964
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1062
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
1112
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
1531
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
1551
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1554
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1557
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1591
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
1611
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1614
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected);
1928
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
1964
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
2074
comp2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2084
comp3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2097
comp4.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2127
comp5.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected1);
2130
comp6.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2140
comp7.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2153
comp8.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(expected1);
2156
comp9.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2169
comp10.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.HDN_UnusedUsingDirective or (int)ErrorCode.HDN_UnusedExternAlias)).Verify(
2251
comp2.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2265
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2268
comp4.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2271
comp5.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2274
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2277
comp7.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2280
comp8.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2283
comp9.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2396
comp2.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2413
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2416
comp4.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2419
comp5.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2422
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2425
comp7.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2428
comp8.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2431
comp9.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2492
comp2.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2509
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2512
comp4.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2515
comp5.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2518
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2521
comp7.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
2524
comp8.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
2527
comp9.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
4221
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1);
4224
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1);
4227
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(
4241
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected2);
4249
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected2);
4257
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1);
4260
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected1);
4263
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.ERR_DuplicateAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(
4277
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3);
4285
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3);
4293
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3);
4301
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(expected3);
4309
comp.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadExternAlias or (int)ErrorCode.HDN_UnusedUsingDirective)).Verify(
4375
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4378
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4381
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4384
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4387
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4394
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4401
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4471
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4474
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4477
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4480
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4483
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4490
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4497
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
4926
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4929
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4932
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected1);
4945
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
4948
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(expected2);
4951
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.HDN_UnusedUsingDirective).Verify(
Semantics\ImportsTests.cs (1)
147
comp.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\InheritanceBindingTests.cs (1)
8239
var actualErrors = comp.
GetDiagnostics
();
Semantics\InteractiveUsingTests.cs (10)
142
CreateCompilation(source).
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
143
CreateSubmission(source).
GetDiagnostics
().Verify(expectedDiagnostics);
161
CreateCompilation(source, options: options).
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
162
CreateSubmission(source, options: options).
GetDiagnostics
().Verify(expectedDiagnostics);
179
CreateCompilation(source).
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
180
CreateSubmission(source).
GetDiagnostics
().Verify(expectedDiagnostics);
251
CreateCompilation(source).
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
252
CreateSubmission(source).
GetDiagnostics
().Verify(expectedDiagnostics);
270
CreateCompilation(source, options: options).
GetDiagnostics
().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
271
CreateSubmission(source, options: options).
GetDiagnostics
().Verify(expectedDiagnostics);
Semantics\LambdaTests.cs (3)
387
Assert.Equal(0, comp2.
GetDiagnostics
().Count());
475
var errs = comp.
GetDiagnostics
();
532
Assert.Equal(0, csProject.
GetDiagnostics
().Count());
Semantics\MethodBodyModelTests.cs (8)
127
foreach (var e in comp.
GetDiagnostics
())
418
Assert.Equal(1, comp.
GetDiagnostics
().Count());
442
Assert.Equal(1, comp.
GetDiagnostics
().Count());
465
Assert.Equal(1, comp.
GetDiagnostics
().Count());
488
Assert.Equal(1, comp.
GetDiagnostics
().Count());
511
Assert.Equal(1, comp.
GetDiagnostics
().Count());
617
var diags = comp.
GetDiagnostics
();
797
Assert.Equal(string.Empty, string.Join(Environment.NewLine, comp.
GetDiagnostics
()));
Semantics\NullableReferenceTypesTests.cs (74)
98650
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
99338
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
99463
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
100115
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
100160
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
100234
comp3.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
100265
comp6.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
108330
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
108394
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
108541
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
108703
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify();
108774
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
109194
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify(
109310
comp1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_MissingNonNullTypesContextForAnnotation).Verify();
111951
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_UninitializedNonNullableField).Verify(
112025
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.WRN_UninitializedNonNullableField).Verify(
112489
var diagnostics = comp.
GetDiagnostics
();
125127
var diagnostics = comp.
GetDiagnostics
();
125136
diagnostics = comp.
GetDiagnostics
();
125145
diagnostics = comp.
GetDiagnostics
();
125156
diagnostics = comp.
GetDiagnostics
();
125165
diagnostics = comp.
GetDiagnostics
();
125176
diagnostics = comp.
GetDiagnostics
();
125186
diagnostics = comp.
GetDiagnostics
();
125196
diagnostics = comp.
GetDiagnostics
();
125202
diagnostics = comp.
GetDiagnostics
();
125207
diagnostics = comp.
GetDiagnostics
();
125211
diagnostics = comp.
GetDiagnostics
();
125222
diagnostics = comp.
GetDiagnostics
();
125232
diagnostics = comp.
GetDiagnostics
();
125243
diagnostics = comp.
GetDiagnostics
();
125462
var diagnostics = comp.
GetDiagnostics
();
125471
diagnostics = comp.
GetDiagnostics
();
125480
diagnostics = comp.
GetDiagnostics
();
125491
diagnostics = comp.
GetDiagnostics
();
125500
diagnostics = comp.
GetDiagnostics
();
125511
diagnostics = comp.
GetDiagnostics
();
125521
diagnostics = comp.
GetDiagnostics
();
125531
diagnostics = comp.
GetDiagnostics
();
125537
diagnostics = comp.
GetDiagnostics
();
125542
diagnostics = comp.
GetDiagnostics
();
125546
diagnostics = comp.
GetDiagnostics
();
125557
diagnostics = comp.
GetDiagnostics
();
125567
diagnostics = comp.
GetDiagnostics
();
125578
diagnostics = comp.
GetDiagnostics
();
126001
var diagnostics = comp.
GetDiagnostics
();
126005
diagnostics = comp.
GetDiagnostics
();
126009
diagnostics = comp.
GetDiagnostics
();
126015
diagnostics = comp.
GetDiagnostics
();
126019
diagnostics = comp.
GetDiagnostics
();
126025
diagnostics = comp.
GetDiagnostics
();
126030
diagnostics = comp.
GetDiagnostics
();
126035
diagnostics = comp.
GetDiagnostics
();
126041
diagnostics = comp.
GetDiagnostics
();
126046
diagnostics = comp.
GetDiagnostics
();
126050
diagnostics = comp.
GetDiagnostics
();
126056
diagnostics = comp.
GetDiagnostics
();
126061
diagnostics = comp.
GetDiagnostics
();
126067
diagnostics = comp.
GetDiagnostics
();
126147
var diagnostics = comp.
GetDiagnostics
();
126151
diagnostics = comp.
GetDiagnostics
();
126155
diagnostics = comp.
GetDiagnostics
();
126161
diagnostics = comp.
GetDiagnostics
();
126165
diagnostics = comp.
GetDiagnostics
();
126171
diagnostics = comp.
GetDiagnostics
();
126176
diagnostics = comp.
GetDiagnostics
();
126181
diagnostics = comp.
GetDiagnostics
();
126187
diagnostics = comp.
GetDiagnostics
();
126192
diagnostics = comp.
GetDiagnostics
();
126196
diagnostics = comp.
GetDiagnostics
();
126202
diagnostics = comp.
GetDiagnostics
();
126207
diagnostics = comp.
GetDiagnostics
();
126213
diagnostics = comp.
GetDiagnostics
();
145254
comp.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_UseDefViolation).Verify(
Semantics\OperatorTests.cs (2)
6272
CreateCompilation(text).
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
6293
CreateCompilation(text).
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\OverloadResolutionPerfTests.cs (1)
312
var diagnostics = comp.
GetDiagnostics
().Where(d => d is not { Severity: DiagnosticSeverity.Info, Code: (int)ErrorCode.INF_TooManyBoundLambdas });
Semantics\OverloadResolutionTests.cs (4)
2302
Assert.Empty(cCommon.
GetDiagnostics
());
2308
Assert.Empty(cCS.
GetDiagnostics
());
2332
cFinal.
GetDiagnostics
();
7838
Assert.Equal("(30,19): error CS0121: The call is ambiguous between the following methods or properties: 'A.B.X.Test(int)' and 'A.C.X.Test(int)'", DiagnosticFormatter.Instance.Format(comp.
GetDiagnostics
()[0], EnsureEnglishUICulture.PreferredOrNull));
Semantics\QueryTests.cs (4)
1658
foreach (var dd in compilation.
GetDiagnostics
()) Console.WriteLine(dd);
3109
Assert.NotEmpty(compilation.
GetDiagnostics
());
4071
.
GetDiagnostics
()
4113
.
GetDiagnostics
()
Semantics\RefEscapingTests.cs (1)
48
Assert.True(comp.
GetDiagnostics
().All(d => d.Severity != DiagnosticSeverity.Error));
Semantics\RefLocalsAndReturnsTests.cs (1)
2886
.
GetDiagnostics
()
Semantics\SemanticErrorTests.cs (3)
1693
var diagnostics = CreateCompilation(text).
GetDiagnostics
();
3254
var errs = comp.
GetDiagnostics
();
16723
Assert.False(comp.
GetDiagnostics
().Any());
Semantics\UninitializedNonNullableFieldTests.cs (3)
2752
var actualAdditionalLocations = comp.
GetDiagnostics
().Single().AdditionalLocations;
2773
var actualAdditionalLocations = comp.
GetDiagnostics
().Single().AdditionalLocations;
2802
var diagnostics = comp.
GetDiagnostics
();
Semantics\UnsafeTests.cs (1)
5189
var compilationDiagnostics = compilation.
GetDiagnostics
();
Semantics\UseSiteErrorTests.cs (2)
1237
foreach (var diag in compilation.
GetDiagnostics
())
2442
var diagnostics = compilation.
GetDiagnostics
();
Semantics\VarianceTests.cs (2)
114
var errors = comp.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error);
227
var errors = comp.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (271)
Compilation\CompilationAPITests.cs (15)
628
Assert.Empty(comp.
GetDiagnostics
());
639
var errs = comp.
GetDiagnostics
();
696
Assert.Empty(comp.
GetDiagnostics
());
707
var errs = comp.
GetDiagnostics
();
834
var error = comp.
GetDiagnostics
();
835
Assert.InRange(comp.
GetDiagnostics
().Count(), 0, int.MaxValue);
889
Assert.InRange(comp.
GetDiagnostics
().Count(), 0, int.MaxValue);
893
var e = comp.
GetDiagnostics
(cancellationToken: default(CancellationToken));
894
Assert.Equal(0, comp.
GetDiagnostics
(cancellationToken: default(CancellationToken)).Count());
898
error = comp.
GetDiagnostics
(cancellationToken: CancellationToken.None);
899
Assert.InRange(comp.
GetDiagnostics
().Count(), 0, int.MaxValue);
902
Assert.Equal(0, comp.
GetDiagnostics
().Count());
910
Assert.Equal(0, comp.
GetDiagnostics
().Count());
1943
compilation.
GetDiagnostics
().Verify(
1956
compilation.
GetDiagnostics
().Verify(
Compilation\GetSemanticInfoTests.cs (1)
5893
var diag = comp.
GetDiagnostics
();
Compilation\LoadDirectiveTests.cs (1)
61
compilation.
GetDiagnostics
().Verify(
Compilation\SemanticModelAPITests.cs (1)
4366
compilation.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
DocumentationComments\DocumentationCommentCompilerTests.cs (4)
3419
CreateCompilationUtil(source).
GetDiagnostics
().VerifyWithFallbackToErrorCodeOnlyForNonEnglish(
5862
Assert.NotEmpty(comp.
GetDiagnostics
());
5884
Assert.Equal(2, comp.
GetDiagnostics
().Count());
7401
CreateCompilationUtil(source).
GetDiagnostics
().VerifyWithFallbackToErrorCodeOnlyForNonEnglish(
DocumentationComments\DocumentationModeTests.cs (1)
388
comp.
GetDiagnostics
().Verify(fallbackToErrorCodeOnlyForNonEnglish: fallbackToErrorCodeOnlyForNonEnglish, expected: makeExpectedDiagnostics(includeElement));
DocumentationComments\TypeDocumentationCommentTests.cs (1)
140
Assert.Equal(0, comp.
GetDiagnostics
().Count());
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (2)
326
Assert.False(compilation.
GetDiagnostics
().Any());
359
Assert.False(compilation.
GetDiagnostics
().Any());
Symbols\CheckedUserDefinedOperatorsTests.cs (61)
146
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
154
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
189
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
210
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
229
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
251
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
313
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
349
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
374
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
399
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
571
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
634
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
641
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
658
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
684
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
692
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
710
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
743
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
1364
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1397
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1420
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1483
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1519
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1546
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1572
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1625
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1753
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
1785
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
1808
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1823
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1841
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1925
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
1933
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
1951
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
1985
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
2050
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
2058
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2076
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
2173
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
2216
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
2273
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2284
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2317
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2367
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2378
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2411
compilation.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).
2431
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2607
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2639
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2658
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2717
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2751
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2774
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2797
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
2907
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
2965
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
3017
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
3025
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
3043
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify();
3073
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
3131
compilation.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(expected);
Symbols\CompilationCreationTests.cs (2)
2823
var diagnostics = compilation.
GetDiagnostics
().ToArray();
2863
var diags = compilation.
GetDiagnostics
().ToArray();
Symbols\ConversionTests.cs (4)
790
var diagnostics = compilation.
GetDiagnostics
();
810
var diagnostics = compilation.
GetDiagnostics
();
856
var diagnostics = compilation.
GetDiagnostics
();
878
var diagnostics = compilation.
GetDiagnostics
();
Symbols\DefaultInterfaceImplementationTests.cs (9)
26803
compilation1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_EventNeedsBothAccessors).Verify(
27137
compilation1.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_EventNeedsBothAccessors).Verify(
27227
compilation2.
GetDiagnostics
().Where(d => d.Code != (int)ErrorCode.ERR_EventNeedsBothAccessors).Verify(
51060
compilation1.
GetDiagnostics
().VerifyErrorCodes(expected);
51081
compilation3.
GetDiagnostics
().VerifyErrorCodes(expected);
68533
compilation3.
GetDiagnostics
().VerifyErrorCodes(
68596
compilation3.
GetDiagnostics
().VerifyErrorCodes(
68693
compilation2.
GetDiagnostics
().VerifyErrorCodes(
68704
compilation3.
GetDiagnostics
().VerifyErrorCodes(
Symbols\ExtensionMethodTests.cs (1)
2616
CreateCompilation(text).
GetDiagnostics
();
Symbols\GenericConstraintTests.cs (1)
5858
Assert.NotEmpty(compilation.
GetDiagnostics
());
Symbols\InterfaceImplementationTests.cs (7)
909
Assert.False(comp.
GetDiagnostics
().Any(), string.Join("\n", comp.
GetDiagnostics
()));
970
Assert.False(comp1.
GetDiagnostics
().Any(), string.Join("\n", comp1.
GetDiagnostics
()));
976
Assert.False(comp2.
GetDiagnostics
().Any(), string.Join("\n", comp2.
GetDiagnostics
()));
1057
Assert.False(comp.
GetDiagnostics
().Any());
Symbols\Metadata\MetadataMemberTests.cs (1)
395
Assert.False(compilation.
GetDiagnostics
().Any());
Symbols\MissingSpecialMember.cs (4)
198
comp.
GetDiagnostics
();
205
comp.
GetDiagnostics
();
348
comp.
GetDiagnostics
();
433
comp.
GetDiagnostics
();
Symbols\OverriddenOrHiddenMembersTests.cs (6)
900
Assert.False(comp.
GetDiagnostics
().Any());
1136
Assert.Empty(comp.
GetDiagnostics
());
1154
Assert.Empty(comp.
GetDiagnostics
());
1862
Assert.Equal(0, comp.
GetDiagnostics
().Count());
2198
c2.
GetDiagnostics
().Verify();
2241
c2.
GetDiagnostics
().Verify();
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (5)
120
Assert.False(comp2.
GetDiagnostics
().Any());
349
var d = comp1.
GetDiagnostics
();
350
Assert.False(comp1.
GetDiagnostics
().Any());
357
foreach (var diag in comp1.
GetDiagnostics
())
384
Assert.False(comp2.
GetDiagnostics
().Any());
Symbols\Source\BaseClassTests.cs (3)
1617
Assert.Equal(0, c1.
GetDiagnostics
().Count());
1618
Assert.Equal(0, c2.
GetDiagnostics
().Count());
1623
Assert.Equal(0, c2.
GetDiagnostics
().Count());
Symbols\Source\ClsComplianceTests.cs (1)
3758
CreateCompilationWithMscorlib40AndSystemCore(source, new[] { libRef }).
GetDiagnostics
();
Symbols\Source\EnumTests.cs (13)
173
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(),
185
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(),
205
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_IdentifierExpected });
216
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_DuplicateNameInClass });
290
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp1.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_IdentifierExpectedKW },
328
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
());
398
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
());
427
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_DuplicateCaseLabel });
470
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_NonInterfaceInInterfaceList },
490
DiagnosticsUtils.VerifyErrorCodesNoLineColumn(comp.
GetDiagnostics
(), new ErrorDescription { Code = (int)ErrorCode.ERR_EOFExpected },
710
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
(),
723
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
()); // ok
731
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
(),
Symbols\Source\ExternAliasTests.cs (2)
89
comp.
GetDiagnostics
().Verify();
141
comp.
GetDiagnostics
().Verify();
Symbols\Source\FileModifierTests.cs (3)
1799
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_FileTypeNested).Verify();
1858
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_FileTypeNested).Verify();
1866
comp.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_FileTypeNested).Verify();
Symbols\Source\MethodTests.cs (9)
585
Assert.Equal(0, comp.
GetDiagnostics
().Count());
769
Assert.Equal(0, comp1.
GetDiagnostics
().Count());
770
Assert.Equal(0, comp2.
GetDiagnostics
().Count());
771
Assert.Equal(0, comp.
GetDiagnostics
().Count());
1058
Assert.Equal(0, comp1.
GetDiagnostics
().Count());
1059
Assert.Equal(0, comp2.
GetDiagnostics
().Count());
1060
Assert.Equal(0, comp.
GetDiagnostics
().Count());
1163
Assert.Equal(0, comp.
GetDiagnostics
().Count());
1257
Assert.Equal(0, comp.
GetDiagnostics
().Count());
Symbols\Source\PropertyTests.cs (5)
518
var actualErrors = compilation.
GetDiagnostics
();
623
var actualErrors = compilation.
GetDiagnostics
();
1654
var diagnostics = comp.
GetDiagnostics
();
1691
var diagnostics = comp.
GetDiagnostics
();
1726
var diagnostics = comp.
GetDiagnostics
();
Symbols\Source\UsingAliasTests.cs (1)
667
var discarded = comp.
GetDiagnostics
();
Symbols\StaticAbstractMembersInInterfacesTests.cs (93)
4017
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
4062
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
4107
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
4455
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
4500
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
4545
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
5706
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
5753
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
5781
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
5830
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
7242
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7336
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_UnimplementedInterfaceMember).Verify(
7441
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_UnimplementedInterfaceMember).Verify(
7547
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7641
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7740
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
7857
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_UnimplementedInterfaceMember).Verify(
7977
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_UnimplementedInterfaceMember).Verify(
8074
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
8171
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_InterfacesCantContainConversionOrEqualityOperators or (int)ErrorCode.ERR_UnimplementedInterfaceMember)).Verify(
8676
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
9131
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
9215
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
9991
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature).Verify(
10295
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
10415
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature or (int)ErrorCode.ERR_GenericConstraintNotSatisfiedInterfaceWithStaticAbstractMembers)).Verify(
12200
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
12299
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_RuntimeDoesNotSupportDefaultInterfaceImplementation).Verify(builder.ToArrayAndFree());
12350
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
12484
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
12495
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
12649
compilation2.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
12684
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
17610
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
17753
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_BadIncDecRetType or (int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
17889
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18032
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18144
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18291
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
18511
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
18703
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(expected);
18811
compilation2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected2);
18860
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(expected3);
18912
compilation2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18941
compilation2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
18965
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or
19007
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19068
compilation2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19078
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType)).Verify(
19120
compilation2.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19130
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or (int)ErrorCode.WRN_EqualityOpWithoutGetHashCode)).Verify(
19182
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch)).Verify(
19237
compilation3.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_CheckedOperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22050
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_OperatorNeedsMatch)).Verify(
22200
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.WRN_ExternMethodNoImplementation or (int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22266
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OpTFRetType or (int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
22311
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.ERR_BadAbstractEqualityOperatorSignature)).Verify(
27895
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28038
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28147
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28304
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28440
compilation2.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28473
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28528
compilation2.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28538
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28580
compilation2.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
28590
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
29862
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.WRN_ExternMethodNoImplementation).Verify(
29992
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
30058
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_GenericConstraintNotSatisfiedInterfaceWithStaticAbstractMembers).Verify(
30535
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
30666
compilation3.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32272
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32313
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32348
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32389
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32431
compilation1.
GetDiagnostics
().Where(d => d.Code is not ((int)ErrorCode.ERR_OperatorNeedsMatch or (int)ErrorCode.WRN_EqualityOpWithoutEquals or
32477
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32519
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32555
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32597
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32659
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32697
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32729
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32767
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32799
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32837
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32869
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32907
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32939
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
32977
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
33009
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
33047
compilation1.
GetDiagnostics
().Where(d => d.Code is not (int)ErrorCode.ERR_CheckedOperatorNeedsMatch).Verify(
Symbols\SymbolDistinguisherTests.cs (1)
744
var diagnostics = compilation2.
GetDiagnostics
();
Symbols\SymbolErrorTests.cs (2)
20402
comp3.
GetDiagnostics
().Verify(expected);
20406
comp4.
GetDiagnostics
().Verify(expected);
Symbols\TypeTests.cs (10)
200
Assert.Equal(0, comp1.
GetDiagnostics
().Count());
201
Assert.Equal(0, comp2.
GetDiagnostics
().Count());
202
Assert.Equal(0, comp.
GetDiagnostics
().Count());
382
Assert.Equal(0, comp.
GetDiagnostics
().Count());
401
Assert.Equal(0, comp.
GetDiagnostics
().Count());
420
Assert.Equal(0, comp.
GetDiagnostics
().Count());
443
Assert.Equal(0, comp.
GetDiagnostics
().Count());
1236
Assert.Equal(4, comp.
GetDiagnostics
().Count());
1386
Assert.Empty(comp.
GetDiagnostics
());
1407
Assert.Empty(comp.
GetDiagnostics
());
Symbols\TypeUnificationTests.cs (1)
420
DiagnosticsUtils.VerifyErrorCodes(comp.
GetDiagnostics
(),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (111)
Diagnostics\DiagnosticTest.cs (5)
148
var actualErrors = comp.
GetDiagnostics
();
2437
Assert.Equal(1, compilation.
GetDiagnostics
().Length);
2438
Assert.Equal(1, compilation.
GetDiagnostics
().Length);
2486
AssertEx.Equal(CreateCompilation(tree).
GetDiagnostics
(), CreateCompilation(tree).
GetDiagnostics
());
Parsing\AnonymousFunctionParsingTests.cs (23)
113
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
213
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
311
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
412
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
513
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
627
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify();
768
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
877
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
2578
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
2726
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
2875
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
2994
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify();
3140
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
3254
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
3404
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
3557
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
3711
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
3839
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify();
3994
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
4117
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
4276
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
4438
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
4601
CreateCompilation(test, parseOptions: TestOptions.Regular8).
GetDiagnostics
().Verify(
Parsing\ParserErrorMessageTests.cs (1)
5870
CreateCompilation(test).
GetDiagnostics
().Verify(
Parsing\StatementAttributeParsingTests.cs (81)
79
CreateCompilation(test).
GetDiagnostics
().Verify(
144
CreateCompilation(test).
GetDiagnostics
().Verify(
228
CreateCompilation(test).
GetDiagnostics
().Verify(
325
CreateCompilation(test).
GetDiagnostics
().Verify(
410
CreateCompilation(test).
GetDiagnostics
().Verify(
495
CreateCompilation(test).
GetDiagnostics
().Verify(
561
CreateCompilation(test).
GetDiagnostics
().Verify(
627
CreateCompilation(test).
GetDiagnostics
().Verify(
701
CreateCompilation(test).
GetDiagnostics
().Verify(
775
CreateCompilation(test).
GetDiagnostics
().Verify(
850
CreateCompilation(test).
GetDiagnostics
().Verify(
931
CreateCompilation(test).
GetDiagnostics
().Verify(
1009
CreateCompilation(test).
GetDiagnostics
().Verify(
1083
CreateCompilation(test).
GetDiagnostics
().Verify(
1185
CreateCompilation(test).
GetDiagnostics
().Verify(
1319
CreateCompilation(test).
GetDiagnostics
().Verify(
1395
CreateCompilation(test).
GetDiagnostics
().Verify(
1472
CreateCompilation(test).
GetDiagnostics
().Verify(
1559
CreateCompilation(test).
GetDiagnostics
().Verify(
1681
CreateCompilation(test).
GetDiagnostics
().Verify(
1754
CreateCompilation(test).
GetDiagnostics
().Verify(
1824
CreateCompilation(test).
GetDiagnostics
().Verify(
1894
CreateCompilation(test).
GetDiagnostics
().Verify(
1964
CreateCompilation(test).
GetDiagnostics
().Verify(
2061
CreateCompilation(test).
GetDiagnostics
().Verify(
2152
CreateCompilation(test).
GetDiagnostics
().Verify(
2228
CreateCompilation(test).
GetDiagnostics
().Verify(
2301
CreateCompilation(test).
GetDiagnostics
().Verify(
2394
CreateCompilation(test).
GetDiagnostics
().Verify(
2507
CreateCompilation(test).
GetDiagnostics
().Verify(
2619
CreateCompilation(test).
GetDiagnostics
().Verify(
2716
CreateCompilation(test).
GetDiagnostics
().Verify(
2795
CreateCompilation(test).
GetDiagnostics
().Verify(
2898
CreateCompilation(test).
GetDiagnostics
().Verify(
2983
CreateCompilation(test).
GetDiagnostics
().Verify(
3086
CreateCompilation(test).
GetDiagnostics
().Verify(
3171
CreateCompilation(test).
GetDiagnostics
().Verify(
3247
CreateCompilation(test).
GetDiagnostics
().Verify(
3324
CreateCompilation(test).
GetDiagnostics
().Verify(
3407
CreateCompilation(test).
GetDiagnostics
().Verify(
3492
CreateCompilation(test).
GetDiagnostics
().Verify(
3574
CreateCompilation(test).
GetDiagnostics
().Verify(
3664
CreateCompilation(test).
GetDiagnostics
().Verify(
3745
CreateCompilation(test).
GetDiagnostics
().Verify(
3819
CreateCompilation(test).
GetDiagnostics
().Verify(
3912
CreateCompilation(test).
GetDiagnostics
().Verify(
3995
CreateCompilation(test).
GetDiagnostics
().Verify(
4083
CreateCompilation(test).
GetDiagnostics
().Verify(
4168
CreateCompilation(test).
GetDiagnostics
().Verify(
4244
CreateCompilation(test).
GetDiagnostics
().Verify(
4324
CreateCompilation(test).
GetDiagnostics
().Verify(
4412
CreateCompilation(test).
GetDiagnostics
().Verify(
4501
CreateCompilation(test).
GetDiagnostics
().Verify(
4601
CreateCompilation(test).
GetDiagnostics
().Verify(
4676
CreateCompilation(test).
GetDiagnostics
().Verify(
4748
CreateCompilation(test).
GetDiagnostics
().Verify(
4846
CreateCompilation(test).
GetDiagnostics
().Verify(
4945
CreateCompilation(test).
GetDiagnostics
().Verify(
5025
CreateCompilation(test).
GetDiagnostics
().Verify(
5094
CreateCompilation(test).
GetDiagnostics
().Verify(
5182
CreateCompilation(test).
GetDiagnostics
().Verify(
5263
CreateCompilation(test).
GetDiagnostics
().Verify(
5349
CreateCompilation(test).
GetDiagnostics
().Verify(
5423
CreateCompilation(test).
GetDiagnostics
().Verify(
5507
CreateCompilation(test).
GetDiagnostics
().Verify(
5596
CreateCompilation(test).
GetDiagnostics
().Verify(
5717
CreateCompilation(test).
GetDiagnostics
().Verify(
5814
CreateCompilation(test).
GetDiagnostics
().Verify(
5916
CreateCompilation(test).
GetDiagnostics
().Verify(
6188
CreateCompilation(test).
GetDiagnostics
().Verify(
6274
CreateCompilation(test).
GetDiagnostics
().Verify(
6358
CreateCompilation(test).
GetDiagnostics
().Verify(
6437
CreateCompilation(test).
GetDiagnostics
().Verify(
6521
CreateCompilation(test).
GetDiagnostics
().Verify(
6611
CreateCompilation(test).
GetDiagnostics
().Verify(
6747
CreateCompilation(test).
GetDiagnostics
().Verify(
6856
CreateCompilation(tree).
GetDiagnostics
().Verify(
7119
CreateCompilation(test).
GetDiagnostics
().Verify(
7226
CreateCompilation(test).
GetDiagnostics
().Verify(
7328
CreateCompilation(test).
GetDiagnostics
().Verify(
7437
CreateCompilation(test).
GetDiagnostics
().Verify(
Syntax\LambdaUtilitiesTests.cs (1)
44
compilation.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
CSharpTestBase.cs (3)
1360
var compileDiagnostics = comp.
GetDiagnostics
();
2124
var actualDiagnostics = compilation.
GetDiagnostics
().Where(d => d.Severity != DiagnosticSeverity.Hidden);
2135
var actualDiagnostics = compilation.
GetDiagnostics
().Where(d => d.Severity != DiagnosticSeverity.Hidden);
DiagnosticTestUtilities.cs (2)
48
var actualErrors = comp.
GetDiagnostics
();
86
var actualErrors = comp.
GetDiagnostics
();
SemanticSearch.BuildTask.UnitTests (3)
GenerateFilteredReferenceAssembliesTaskTests.cs (3)
130
c.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
178
c.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
227
c.
GetDiagnostics
().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
StackDepthTest (1)
Program.cs (1)
82
var diag = comp.
GetDiagnostics
();