diff --git a/src/xunit.analyzers.tests/Utility/CSharpVerifier.cs b/src/xunit.analyzers.tests/Utility/CSharpVerifier.cs index 673ff9ee..5de62cf7 100644 --- a/src/xunit.analyzers.tests/Utility/CSharpVerifier.cs +++ b/src/xunit.analyzers.tests/Utility/CSharpVerifier.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -812,6 +813,9 @@ protected TestBase( // Diagnostics are reported in both normal and generated code TestBehaviors |= TestBehaviors.SkipGeneratedCodeCheck; + + // Tests that check for messages should run independent of current system culture. + CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; } public LanguageVersion LanguageVersion { get; } diff --git a/src/xunit.analyzers/Utility/Descriptors.cs b/src/xunit.analyzers/Utility/Descriptors.cs index 886fd358..a052dc96 100644 --- a/src/xunit.analyzers/Utility/Descriptors.cs +++ b/src/xunit.analyzers/Utility/Descriptors.cs @@ -308,10 +308,10 @@ static DiagnosticDescriptor Rule( public static DiagnosticDescriptor X1030_DoNotUseConfigureAwait { get; } = Rule( "xUnit1030", - "Do not call ConfigureAwait in test method", + "Do not call ConfigureAwait(false) in test method", Usage, Warning, - "Test methods should not call ConfigureAwait(), as it may bypass parallelization limits." + "Test methods should not call ConfigureAwait(false), as it may bypass parallelization limits. Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007." ); public static DiagnosticDescriptor X1031_DoNotUseBlockingTaskOperations { get; } =