127 references to CSharpCodeFixVerifier
Microsoft.ML.CodeAnalyzer.Tests (127)
Code\BaseTestClassTest.cs (5)
9
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
32
await new
VerifyCS
.Test
51
await new
VerifyCS
.Test
75
await new
VerifyCS
.Test
101
await new
VerifyCS
.Test
Code\BestFriendOnPublicDeclarationTest.cs (12)
10
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
25
VerifyCS
.Diagnostic().WithLocation(8, 6).WithArguments("PublicClass"),
26
VerifyCS
.Diagnostic().WithLocation(11, 10).WithArguments("PublicField"),
27
VerifyCS
.Diagnostic().WithLocation(14, 10).WithArguments("PublicProperty"),
28
VerifyCS
.Diagnostic().WithLocation(20, 10).WithArguments("PublicMethod"),
29
VerifyCS
.Diagnostic().WithLocation(26, 10).WithArguments("PublicDelegate"),
30
VerifyCS
.Diagnostic().WithLocation(29, 10).WithArguments("PublicClass"),
31
VerifyCS
.Diagnostic().WithLocation(35, 6).WithArguments("PublicStruct"),
32
VerifyCS
.Diagnostic().WithLocation(40, 6).WithArguments("PublicEnum"),
33
VerifyCS
.Diagnostic().WithLocation(47, 6).WithArguments("PublicInterface"),
34
VerifyCS
.Diagnostic().WithLocation(102, 10).WithArguments("PublicMethod"),
37
var test = new
VerifyCS
.Test
Code\BestFriendTest.cs (14)
12
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
40
VerifyCS
.Diagnostic().WithLocation(10, 31).WithArguments("A"),
41
VerifyCS
.Diagnostic().WithLocation(11, 31).WithArguments("A"),
42
VerifyCS
.Diagnostic().WithLocation(11, 33).WithArguments("My"),
43
VerifyCS
.Diagnostic().WithLocation(14, 33).WithArguments("Awhile"),
44
VerifyCS
.Diagnostic().WithLocation(15, 33).WithArguments("And"),
45
VerifyCS
.Diagnostic().WithLocation(18, 13).WithArguments("A"),
46
VerifyCS
.Diagnostic().WithLocation(18, 25).WithArguments("A"),
48
VerifyCS
.Diagnostic().WithLocation(25, 13).WithArguments("IA"),
49
VerifyCS
.Diagnostic().WithLocation(25, 23).WithArguments("IA"),
50
VerifyCS
.Diagnostic().WithLocation(32, 38).WithArguments(".ctor"),
51
VerifyCS
.Diagnostic().WithLocation(38, 38).WithArguments(".ctor"),
54
VerifyCS
.Test test = null;
55
test = new
VerifyCS
.Test
Code\ContractsCheckTest.cs (31)
12
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
30
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 8, 46).WithArguments("CheckParam", "paramName", "\"p\""),
31
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 9, 46).WithArguments("CheckParam", "paramName", "nameof(p) + nameof(p)"),
32
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 11, 28).WithArguments("CheckValue", "paramName", "\"p\""),
33
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 13, 39).WithArguments("CheckUserArg", "name", "\"foo\""),
34
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(basis + 15, 13).WithArguments("Except"),
35
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(basis + 16, 13).WithArguments("ExceptParam"),
36
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 22, 39).WithArguments("ExceptParam", "paramName", "\"env\""),
37
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.SimpleMessageDiagnostic.Rule).WithLocation(basis + 24, 29).WithArguments("Check", "$\"Hello {foo} is cool\""),
38
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.SimpleMessageDiagnostic.Rule).WithLocation(basis + 28, 29).WithArguments("Check", "string.Format(\"Hello {0} is cool\", foo)"),
39
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.SimpleMessageDiagnostic.Rule).WithLocation(basis + 32, 35).WithArguments("Check", "\"Less fine: \" + env.GetType().Name"),
40
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(basis + 34, 17).WithArguments("CheckUserArg", "name", "\"p\""),
41
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.DecodeMessageWithLoadContextDiagnostic.Rule).WithLocation(basis + 39, 41).WithArguments("CheckDecode", "\"This message is suspicious\""),
46
var test = new
VerifyCS
.Test
86
await
VerifyCS
.VerifyAnalyzerAsync(decoySource);
100
var test = new
VerifyCS
.Test
116
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"),
117
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(9, 65).WithArguments("ExceptParam", "paramName", "\"yuck\""),
118
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(13, 39).WithArguments("CheckValue", "paramName", "\"str\""),
119
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(14, 66).WithArguments("CheckUserArg", "name", "\"Foo\""),
120
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(15, 57).WithArguments("CheckUserArg", "name", "\"Bar\""),
121
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(16, 57).WithArguments("CheckUserArg", "name", "\"A\""),
122
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(17, 52).WithArguments("ExceptParam", "paramName", "\"Bar\""),
123
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(20, 17).WithArguments("CheckParam", "paramName", "\"isFive\""),
124
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(21, 49).WithArguments("CheckValue", "paramName", "\"Y\""),
125
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(22, 52).WithArguments("ExceptParam", "paramName", "\"tom\""),
126
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""),
127
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(24, 53).WithArguments("CheckUserArg", "name", "\"chumble\""),
128
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(25, 53).WithArguments("CheckUserArg", "name", "\"sp\""),
147
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.ExceptionDiagnostic.Rule).WithLocation(9, 43).WithArguments("ExceptParam"),
148
VerifyCS
.Diagnostic(ContractsCheckAnalyzer.NameofDiagnostic.Rule).WithLocation(23, 39).WithArguments("CheckValue", "paramName", "\"noMatch\""),
Code\InstanceInitializerTest.cs (5)
8
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
37
VerifyCS
.Diagnostic().WithLocation(6, 21).WithArguments("_foo", "field"),
38
VerifyCS
.Diagnostic().WithLocation(10, 32).WithArguments("_blorg", "field"),
39
VerifyCS
.Diagnostic().WithLocation(13, 23).WithArguments("Bar", "property"),
42
await
VerifyCS
.VerifyAnalyzerAsync(test, expected);
Code\NameTest.cs (33)
8
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
20
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(6, 21).WithArguments("foo"),
21
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(8, 24).WithArguments("_Bubba"),
22
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(9, 22).WithArguments("_shouldParseHTML"),
23
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(12, 23).WithArguments("BillyClub"),
24
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(14, 30).WithArguments("bob"),
25
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(15, 30).WithArguments("CHAZ"),
26
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(18, 21).WithArguments("_liveFromNYC"),
27
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(20, 28).WithArguments("nice"),
30
await
VerifyCS
.VerifyAnalyzerAsync(PrivateTestSource, expected);
60
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(7, 11).WithArguments("CLASS"),
61
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(9, 20).WithArguments("alice"),
62
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(10, 21).WithArguments("_bob"),
63
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(11, 22).WithArguments("_chaz"),
64
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(12, 30).WithArguments("emily"),
65
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(12, 37).WithArguments("_francis"),
66
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(17, 21).WithArguments("this_is_not_python"),
67
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(18, 21).WithArguments("thisIsNotJava"),
68
VerifyCS
.Diagnostic(NameAnalyzer.PrivateFieldName.Rule).WithLocation(22, 30).WithArguments("BadEvent"),
69
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(23, 29).WithArguments("bad_event"),
70
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(26, 30).WithArguments("_badEv"),
71
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(28, 29).WithArguments("one"),
72
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(28, 39).WithArguments("three"),
73
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(29, 22).WithArguments("enumb"),
74
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(29, 35).WithArguments("Two_Two"),
75
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(29, 44).WithArguments("_three"),
76
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(31, 25).WithArguments("_m2"),
77
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(38, 12).WithArguments("marco"),
78
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(38, 31).WithArguments("polo"),
81
var test = new
VerifyCS
.Test
152
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(7, 11).WithArguments("CLASS"),
153
VerifyCS
.Diagnostic(NameAnalyzer.GeneralName.Rule).WithLocation(13, 21).WithArguments("masterBlaster"),
156
await
VerifyCS
.VerifyAnalyzerAsync(source, expected);
Code\ParameterVariableNameTest.cs (11)
8
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
45
VerifyCS
.Diagnostic().WithLocation(8, 22).WithArguments("Unlimited", param),
46
VerifyCS
.Diagnostic().WithLocation(8, 37).WithArguments("POWER", param),
47
VerifyCS
.Diagnostic().WithLocation(10, 31).WithArguments("Tada", local),
48
VerifyCS
.Diagnostic().WithLocation(11, 20).WithArguments("FORMAT", local),
49
VerifyCS
.Diagnostic().WithLocation(12, 17).WithArguments("_coolSum", local),
50
VerifyCS
.Diagnostic().WithLocation(12, 53).WithArguments("CHAR", param),
51
VerifyCS
.Diagnostic().WithLocation(16, 37).WithArguments("Hello", param),
52
VerifyCS
.Diagnostic().WithLocation(16, 64).WithArguments("HelloAgain", param),
53
VerifyCS
.Diagnostic().WithLocation(18, 17).WithArguments("i_think_this_is_python", local),
56
await
VerifyCS
.VerifyAnalyzerAsync(test, expected);
Code\RelaxTestNamingTest.cs (5)
14
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
41
await new
VerifyCS
.Test
68
await new
VerifyCS
.Test
96
await new
VerifyCS
.Test
137
internal class TestWithSuppressor :
VerifyCS
.Test
Code\SingleVariableDeclarationTest.cs (5)
8
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
42
VerifyCS
.Diagnostic().WithLocation(6, 9).WithArguments("a', 'b', 'c"),
43
VerifyCS
.Diagnostic().WithLocation(8, 9).WithArguments("e', 'f"),
44
VerifyCS
.Diagnostic().WithLocation(17, 17).WithArguments("l', 'm"),
47
await
VerifyCS
.VerifyAnalyzerAsync(test, expected);
Code\TypeParamNameTest.cs (6)
8
using VerifyCS = Microsoft.ML.CodeAnalyzer.Tests.Helpers.
CSharpCodeFixVerifier
<
33
VerifyCS
.Diagnostic().WithLocation(4, 26).WithArguments("hello"),
34
VerifyCS
.Diagnostic().WithLocation(6, 21).WithArguments("Tom"),
35
VerifyCS
.Diagnostic().WithLocation(8, 22).WithArguments("mytype"),
36
VerifyCS
.Diagnostic().WithLocation(10, 32).WithArguments("YourType"),
39
await
VerifyCS
.VerifyAnalyzerAsync(test, expected);