Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstringTests.cs (71)
71Sources = { thing, CS.WithBody(testStatements) },
72ExpectedDiagnostics = { CS.DiagnosticAt(0) }
76Sources = { thing, CS.WithBody(fixedStatements) }
140string testCode = CS.WithBody(WithKey($"thing.Consume(foo.{substring})", 0) + ';');
141string fixedCode = CS.WithBody($"thing.Consume(foo.{asSpan});");
148ExpectedDiagnostics = { CS.DiagnosticAt(0) }
247string testCode = CS.WithBody(WithKey($"Thing.Consume({testArguments})", 0) + ';');
248string fixedCode = CS.WithBody($"Thing.Consume({fixedArguments});");
255ExpectedDiagnostics = { CS.DiagnosticAt(0) }
411string testCode = CS.WithBody(WithKey(testExpression, 0) + ';');
412string fixedCode = CS.WithBody(fixedExpression + ';');
419ExpectedDiagnostics = { CS.DiagnosticAt(0) }
569string thing = CS.Usings + @"
601string testCode = CS.WithBody(WithKey(testExpression, 0) + ';');
602string fixedCode = CS.WithBody(fixedExpression + ';');
609ExpectedDiagnostics = { CS.DiagnosticAt(0) }
655string receiver = CS.Usings + @"
701string testCode = CS.WithBody(testExpression + ';');
702string fixedCode = CS.WithBody(fixedExpression + ';');
717test.TestState.ExpectedDiagnostics.AddRange(locations.Select(CS.DiagnosticAt));
758string receiver = CS.Usings + @"
764string testCode = CS.WithBody(WithKey(@"C.Consume(foo.Substring(1))", 0) + ';', includeUsings: false);
765string fixedCode = CS.WithBody(@"C.Consume(foo.AsSpan(1));", includeUsings: true);
772ExpectedDiagnostics = { CS.DiagnosticAt(0) }
786string receiver = CS.Usings + @"
822string receiver = CS.Usings + @"
893ExpectedDiagnostics = { CS.DiagnosticAt(0) },
926ExpectedDiagnostics = { CS.DiagnosticAt(0) },
995CS.WithBody(WithKey(@"Consume(foo.Substring(1), foo.Substring(2), foo.Substring(3))", 0) + ';', members),
996CS.WithBody(@"Consume(foo.AsSpan(1), foo.AsSpan(2), foo.Substring(3));", members)
1005CS.WithBody(WithKey(@"Consume(7, foo.Substring(2), foo.Substring(3))", 0) + ';', members),
1006CS.WithBody(@"Consume(7, foo.Substring(2), foo.AsSpan(3));", members)
1019ExpectedDiagnostics = { CS.DiagnosticAt(0) },
1029string receiver = CS.Usings + @"
1044receiver = CS.Usings + @"
1099CS.WithBody(WithKey(@"Consume(foo.Substring(1), foo.Substring(2))", 0) + ';', members)
1110CS.WithBody(WithKey(@"Consume(foo.Substring(1), foo.Substring(2), foo.Substring(3))", 0) + ';', members)
1122ExpectedDiagnostics = { CS.DiagnosticAt(0) },
1132string receiver = CS.Usings + @"
1145receiver = CS.Usings + @"
1189string thing = CS.Usings + @"
1197thing = CS.Usings + @"
1205thing = CS.Usings + @"
1220string testCode = CS.WithBody(testExpression + ';');
1237string thing = CS.Usings + @"
1244thing = CS.Usings + @"
1252thing = CS.Usings + @"
1292CS.Usings + @"
1303CS.Usings + @"
1319CS.Usings + @"
1334string testCode = CS.WithBody(testStatements);
1353CS.Usings + @"
1364CS.Usings + @"
1380CS.Usings + @"
1434string testCode = CS.Usings + @"
1447Sources = { CS.ExternalBaseClass }
1495Sources = { CS.ExternalBaseClass }
1522string testCode = CS.Usings + @"
1532string fixedCode = CS.Usings + @"
1544Sources = { CS.ExternalBaseClass }
1554ExpectedDiagnostics = { CS.DiagnosticAt(0) }
1600Sources = { CS.ExternalBaseClass }
1633string testCode = CS.Usings + @"
1649Sources = { testCode, CS.InternalBaseClass }
1664string testCode = CS.Usings + @"
1674string fixedCode = CS.Usings + @"
1689Sources = { testCode, CS.InternalBaseClass },
1690ExpectedDiagnostics = { CS.DiagnosticAt(0) }
1694Sources = { fixedCode, CS.InternalBaseClass }
1704string testCode = CS.Usings + @"
1726string receiver = CS.Usings + @"