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