Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public enum IgnoredEnum {{ }}
";

var expectedDiagnostic = Diagnostic().WithLocation(0);
await VerifyCSharpFixAsync("TestType2.cs", testCode, StyleCopSettings, expectedDiagnostic, "TestType.cs", fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync("TestType2.cs", testCode, StyleCopSettings, expectedDiagnostic, "TestType.cs", fixedCode, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task TestThatDiagnosticIIsReportedOnUsingsAndExternAliasOutsideFile
namespace Foo;
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand All @@ -62,7 +62,7 @@ public async Task TestThatDiagnosticIIsReportedOnSpacingWithUsingsInsideFileScop
using a = System.Collections;
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand Down Expand Up @@ -93,7 +93,7 @@ public enum Foobar
}
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand Down Expand Up @@ -131,7 +131,7 @@ public enum Foobar
}
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand All @@ -151,7 +151,7 @@ public async Task TestThatDiagnosticIIsReportedOnExternAliasInsideFileScopedName
extern alias corlib;
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand All @@ -178,7 +178,7 @@ public async Task TestThatDiagnosticIIsReportedOnExternAliasAndUsingsInsideFileS
using a = System.Collections;
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

/// <summary>
Expand Down Expand Up @@ -220,7 +220,7 @@ public enum Foobar
}
";

await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(true);
}

private static Task VerifyCSharpFixAsync(string testCode, string fixedCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ await this.VerifyCSharpFixAsync(
("/0/Test0.cs", fixedCode1),
("TestClass2.cs", fixedCode2),
},
CancellationToken.None).ConfigureAwait(false);
CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task TestUpperCaseFileScopedNamespaceAsync()
{
var testCode = @"namespace Test;";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -32,7 +32,7 @@ public async Task TestLowerCaseFileScopedNamespaceAsync()
var fixedCode = @"namespace Test;";

DiagnosticResult expected = Diagnostic().WithArguments("test").WithLocation(0);
await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -54,7 +54,7 @@ public async Task TestAllowedLowerCaseFileScopedNamespaceIsNotReportedAsync()
{
TestCode = testCode,
Settings = customTestSettings,
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -71,7 +71,7 @@ public async Task TestLowerCaseComplicatedFileScopedNamespaceAsync()
Diagnostic().WithArguments("bar").WithLocation(2),
};

await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -93,7 +93,7 @@ public async Task TestAllowedLowerCaseComplicatedFileScopedNamespaceIsNotReporte
{
TestCode = testCode,
Settings = customTestSettings,
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public R(int a, int b)
}}
";

await VerifyCSharpFixAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, fixedCode, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace TestNamespace;
Diagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorInside).WithLocation(1),
};

await VerifyCSharpFixAsync(testCode, expectedResults, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expectedResults, fixedTestCode, CancellationToken.None).ConfigureAwait(true);
}

[Theory]
Expand All @@ -48,7 +48,7 @@ public async Task TestOnlyGlobalUsingStatementInFileAsync(string leadingTrivia)
{
var testCode = $@"{leadingTrivia}global using System;";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -61,7 +61,7 @@ namespace TestNamespace
{
}";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace TestNamespace;
Diagnostic(SA1200UsingDirectivesMustBePlacedCorrectly.DescriptorOutside).WithLocation(1),
};

await VerifyCSharpFixAsync(testCode, expectedResults, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expectedResults, fixedTestCode, CancellationToken.None).ConfigureAwait(true);
}

[Theory]
Expand All @@ -44,7 +44,7 @@ public async Task TestOnlyGlobalUsingStatementInFileAsync(string leadingTrivia)
{
var testCode = $@"{leadingTrivia}global using System;";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task TestValidUsingStatementsInFileScopedNamespaceAsync()
using System.Threading;
";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

/// <summary>
Expand All @@ -37,7 +37,7 @@ public async Task TestIgnoredUsingStatementsInCompilationUnitWithFileScopedNames
namespace TestNamespace;
";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

[Theory]
Expand All @@ -49,7 +49,7 @@ public async Task TestOnlyGlobalUsingStatementInFileAsync(string leadingTrivia)
{
var testCode = $@"{leadingTrivia}global using System;";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct FooStruct { }
public class FooClass { }
";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -47,7 +47,7 @@ public struct {|#1:FooStruct|} { }
Diagnostic().WithLocation(1).WithArguments("struct", "class"),
};

await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -61,8 +61,8 @@ public record struct FooStruct { }
public class FooClass { }
";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync("namespace OuterNamespace { " + testCode + " }", DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
await VerifyCSharpDiagnosticAsync("namespace OuterNamespace { " + testCode + " }", DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -83,8 +83,8 @@ public record struct {|#1:FooStruct|} { }
Diagnostic().WithLocation(1).WithArguments("record struct", "class"),
};

await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync("namespace OuterNamespace { " + testCode + " }", expected, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(true);
await VerifyCSharpDiagnosticAsync("namespace OuterNamespace { " + testCode + " }", expected, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TestClass2 { }
class TestClass1 { }
";

await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand All @@ -58,7 +58,7 @@ internal class Class4 { }
class Class5 { }
";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static class TestClass2 { }
class TestClass1 { }
";

await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class A
Diagnostic().WithLocation(1).WithArguments("System.IO", "Xyz"),
Diagnostic().WithLocation(2).WithArguments("System.Threading.Tasks", "Xyz"),
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class A
}
";

await VerifyCSharpFixAsync(testCodeNamespace, DiagnosticResult.EmptyDiagnosticResults, fixedTestCodeNamespace, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCodeNamespace, DiagnosticResult.EmptyDiagnosticResults, fixedTestCodeNamespace, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task TestUsingDirectivesInFileScopedNamespaceDeclarationAsync()
using Foo;
",
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task TestUsingDirectivesInFileScopedNamespaceDeclarationAsync()
",
},
Settings = CombinedUsingDirectivesTestSettings,
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task TestUsingDirectivesOrderingInFileScopedNamespaceAsync()
using @int = System.Int32;
",
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task TestUsingDirectivesOrderingInFileScopedNamespaceAsync()
using Execute = System.Action;
",
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async Task TestUsingDirectivesOrderingInFileScopedNamespaceAsync()
using Execute = System.Action;
",
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public bool Method(Test arg)
}
}";

await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Bar
TestCode = oldSource,
ExpectedDiagnostics = { Diagnostic().WithLocation(0) },
FixedCode = newSource,
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal static S F2()
}
";

await VerifyCSharpFixAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, testCode, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpFixAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, testCode, CancellationToken.None).ConfigureAwait(true);
}

[Fact]
Expand Down Expand Up @@ -87,7 +87,7 @@ internal static S F2()
},
AdditionalProjectReferences = { "Reference" },
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace TestNamespace
using KeyValue = System.Collections.Generic.KeyValuePair<string, object?>;
}
";
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(true);
await new CSharpTest
{
TestState =
Expand All @@ -49,7 +49,7 @@ namespace TestNamespace
",
},
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace Namespace6;
class MyAttribute : Attribute {{ }}
",
},
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
}.RunAsync(CancellationToken.None).ConfigureAwait(true);
}
}
}
Loading