|
|
@@ -7,7 +7,6 @@ using Microsoft.CodeAnalysis;
|
|
|
using Microsoft.CodeAnalysis.CSharp.Testing;
|
|
|
using Microsoft.CodeAnalysis.Diagnostics;
|
|
|
using Microsoft.CodeAnalysis.Testing;
|
|
|
-using Microsoft.CodeAnalysis.Testing.Verifiers;
|
|
|
|
|
|
namespace Microsoft.AspNetCore.Mvc.Analyzers;
|
|
|
|
|
|
@@ -58,7 +57,7 @@ namespace AspNetCore
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
Action sometMethod = {|#0:() =>
|
|
|
{
|
|
|
|
|
|
@@ -151,7 +150,7 @@ namespace AspNetCore
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
Func<Task> sometMethod = {|#0:() =>
|
|
|
{
|
|
|
|
|
|
@@ -243,13 +242,13 @@ namespace AspNetCore
|
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
SometMethod();
|
|
|
|
|
|
WriteLiteral(""\r\n"");
|
|
|
}
|
|
|
#pragma warning restore 1998
|
|
|
-
|
|
|
+
|
|
|
{|#0:void SometMethod()
|
|
|
{
|
|
|
|
|
|
@@ -336,7 +335,7 @@ namespace AspNetCore
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
TestDelegate sometMethod = {|#0:delegate ()
|
|
|
{
|
|
|
|
|
|
@@ -368,7 +367,7 @@ namespace AspNetCore
|
|
|
WriteLiteral(""\r\n"");
|
|
|
}
|
|
|
#pragma warning restore 1998
|
|
|
-
|
|
|
+
|
|
|
delegate void TestDelegate();
|
|
|
|
|
|
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
|
|
@@ -430,7 +429,7 @@ namespace AspNetCore
|
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
{|#0:void SometMethod()
|
|
|
{
|
|
|
|
|
|
@@ -520,13 +519,13 @@ namespace AspNetCore
|
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
await SometMethod();
|
|
|
|
|
|
WriteLiteral(""\r\n"");
|
|
|
}
|
|
|
#pragma warning restore 1998
|
|
|
-
|
|
|
+
|
|
|
async Task SometMethod()
|
|
|
{
|
|
|
|
|
|
@@ -611,7 +610,7 @@ namespace AspNetCore
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
TestDelegate sometMethod = async delegate ()
|
|
|
{
|
|
|
|
|
|
@@ -643,7 +642,7 @@ namespace AspNetCore
|
|
|
WriteLiteral(""\r\n"");
|
|
|
}
|
|
|
#pragma warning restore 1998
|
|
|
-
|
|
|
+
|
|
|
delegate Task TestDelegate();
|
|
|
|
|
|
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
|
|
|
@@ -707,7 +706,7 @@ namespace AspNetCore
|
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
async Task SometMethod()
|
|
|
{
|
|
|
|
|
|
@@ -794,13 +793,13 @@ namespace AspNetCore
|
|
|
public async override global::System.Threading.Tasks.Task ExecuteAsync()
|
|
|
{
|
|
|
WriteLiteral(""\r\n"");
|
|
|
-
|
|
|
+
|
|
|
SometMethod();
|
|
|
|
|
|
WriteLiteral(""\r\n"");
|
|
|
}
|
|
|
#pragma warning restore 1998
|
|
|
-
|
|
|
+
|
|
|
{|#0:void SometMethod()
|
|
|
{
|
|
|
|
|
|
@@ -898,7 +897,7 @@ namespace AspNetCore
|
|
|
|
|
|
private static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
|
|
|
{
|
|
|
- var test = new TagHelpersInCodeBlocksCSharpAnalzyerTest(TestReferences.MetadataReferences)
|
|
|
+ var test = new TagHelpersInCodeBlocksCSharpAnalyzerTest(TestReferences.MetadataReferences)
|
|
|
{
|
|
|
TestCode = source,
|
|
|
ReferenceAssemblies = TestReferences.EmptyReferenceAssemblies,
|
|
|
@@ -908,9 +907,9 @@ namespace AspNetCore
|
|
|
return test.RunAsync();
|
|
|
}
|
|
|
|
|
|
- private sealed class TagHelpersInCodeBlocksCSharpAnalzyerTest : CSharpAnalyzerTest<AttributesShouldNotBeAppliedToPageModelAnalyzer, XUnitVerifier>
|
|
|
+ private sealed class TagHelpersInCodeBlocksCSharpAnalyzerTest : CSharpAnalyzerTest<AttributesShouldNotBeAppliedToPageModelAnalyzer, DefaultVerifier>
|
|
|
{
|
|
|
- public TagHelpersInCodeBlocksCSharpAnalzyerTest(ImmutableArray<MetadataReference> metadataReferences)
|
|
|
+ public TagHelpersInCodeBlocksCSharpAnalyzerTest(ImmutableArray<MetadataReference> metadataReferences)
|
|
|
{
|
|
|
TestState.AdditionalReferences.AddRange(metadataReferences);
|
|
|
}
|