示例#1
0
            internal override Task VerifyAsync(string methodName, string[] testSources, string[] fixedSources)
            {
                var test = new Test.Utilities.VisualBasicCodeFixVerifier <TAnalyzer, TCodeFix> .Test();

                foreach (var testSource in testSources)
                {
                    if (!string.IsNullOrEmpty(testSource))
                    {
                        test.TestState.Sources.Add(testSource);
                    }
                }

                test.TestState.ExpectedDiagnostics.Add(
                    Test.Utilities.VisualBasicCodeFixVerifier <TAnalyzer, TCodeFix> .Diagnostic(this.DiagnosticId)
                    .WithLocation(GetNumberOfLines(testSources[0]) - 3, 21)
                    .WithArguments(methodName));

                foreach (var fixedSource in fixedSources)
                {
                    if (!string.IsNullOrEmpty(fixedSource))
                    {
                        test.FixedState.Sources.Add(fixedSource);
                    }
                }

                return(test.RunAsync());
            }
示例#2
0
            internal override Task VerifyAsync(string[] testSources)
            {
                var test = new Test.Utilities.VisualBasicCodeFixVerifier <TAnalyzer, TCodeFix> .Test();

                foreach (var testSource in testSources)
                {
                    if (!string.IsNullOrEmpty(testSource))
                    {
                        test.TestState.Sources.Add(testSource);
                    }
                }

                return(test.RunAsync());
            }