diff --git a/Directory.Packages.props b/Directory.Packages.props
index dbb9c381ac..4cafa6d447 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -8,7 +8,7 @@
17.11.43.11.04.10.0
- 3.11.0-beta1.24605.2
+ 3.11.0-beta1.24629.2$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)6.2.14
@@ -24,7 +24,7 @@
1.1.3-beta1.24423.1
- 3.8.0-preview.24623.10
+ 3.8.0-preview.24631.6
@@ -46,7 +46,7 @@
-
+
diff --git a/.github/codecov.yml b/codecov.yml
similarity index 100%
rename from .github/codecov.yml
rename to codecov.yml
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 836f728084..309409e050 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -13,13 +13,13 @@
https://github.com/dotnet/arcade45d845e04c05fbe5da9838c454bbc3af1df6be81
-
+ https://dev.azure.com/devdiv/DevDiv/_git/vs-code-coverage
- 8ec298cce46b78be7e9ceb9e7403ad555b51f12b
+ d4a113f856a31bcdcbf6e08da8928961c98bb497
-
+ https://github.com/microsoft/testanywhere
- 5475377201a11dba5ed12888525e88e2c86cf6f6
+ 1b35871af094500bb7bf28aa23b61d7135e1fca2
@@ -34,9 +34,9 @@
-
+ https://github.com/dotnet/source-build-reference-packages
- 94798e07efab2663f2d1a71862780bc365d2e3ab
+ 80f1e84b2077a7208943db050067d86c94ace837
diff --git a/eng/Versions.props b/eng/Versions.props
index 4c02e9e431..cfeb2dc685 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -8,8 +8,8 @@
10.0.0-beta.24604.4
- 17.14.0-preview.24620.2
+ 17.14.0-preview.24630.1
- 1.0.0-alpha.24628.3
+ 1.0.0-alpha.24630.3
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.cs.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.cs.xlf
index f1dfec23f3..0e1defb645 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.cs.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.cs.xlf
@@ -68,7 +68,7 @@ byl však přijat tento počet argumentů: {4} s typy {5}.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Časový limit '{0}' testu vypršel po {1}ms.
@@ -419,7 +419,7 @@ Chyba: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Testovací '{0}' se zrušila.
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.de.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.de.xlf
index 816cc3d5dd..4f563a2f9d 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.de.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.de.xlf
@@ -68,7 +68,7 @@ aber empfing {4} Argument(e) mit den Typen „{5}“.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Timeout bei test '{0}' nach {1}ms.
@@ -419,7 +419,7 @@ Fehler: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Test '{0}' wurde abgebrochen.
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.es.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.es.xlf
index 7370dd51bc..a7665e8fe1 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.es.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.es.xlf
@@ -68,7 +68,7 @@ pero recibió {4} argumento(s), con los tipos "{5}".
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Se agotó el tiempo de espera de la '{0}' de pruebas después de {1}ms
@@ -419,7 +419,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Se canceló la '{0}' de pruebas
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.fr.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.fr.xlf
index 8a23aa209d..908df3801d 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.fr.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.fr.xlf
@@ -68,7 +68,7 @@ mais a reçu {4} argument(s), avec les types « {5} ».
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Délai de '{0}' de test dépassé après {1}ms
@@ -419,7 +419,7 @@ Erreur : {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Le test '{0}' a été annulé
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.it.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.it.xlf
index fd8040e388..4bbe3658f6 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.it.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.it.xlf
@@ -68,7 +68,7 @@ ma ha ricevuto {4} argomenti, con tipi "{5}".
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Timeout del '{0}' di test dopo {1}ms
@@ -419,7 +419,7 @@ Errore: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Il '{0}' di test è stato annullato
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ja.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ja.xlf
index 2a3412aa9c..f33a668f43 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ja.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ja.xlf
@@ -69,7 +69,7 @@ but received {4} argument(s), with types '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ テスト '{0}' が {1}ミリ秒後にタイムアウトしました
@@ -420,7 +420,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ テスト '{0}' が取り消されました
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ko.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ko.xlf
index 0287b024b8..83f037d230 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ko.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ko.xlf
@@ -68,7 +68,7 @@ but received {4} argument(s), with types '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ 테스트 '{0}' {1}밀리초 후에 시간 초과되었습니다.
@@ -419,7 +419,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ 테스트 '{0}' 취소되었습니다.
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pl.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pl.xlf
index 4bc9fbaefc..4889dce291 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pl.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pl.xlf
@@ -68,7 +68,7 @@ ale liczba odebranych argumentów to {4} z typami „{5}”.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Upłynął limit czasu '{0}' testu po {1}ms
@@ -419,7 +419,7 @@ Błąd: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Anulowano '{0}' testowe
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pt-BR.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pt-BR.xlf
index 3095b9a4eb..25daeea3dc 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pt-BR.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.pt-BR.xlf
@@ -68,7 +68,7 @@ mas {4} argumentos recebidos, com tipos '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Tempo '{0}' tempo limite do teste após {1}ms
@@ -419,7 +419,7 @@ Erro: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ O '{0}' teste foi cancelado
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ru.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ru.xlf
index a8f146d6bc..ce2e4f5ef3 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ru.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.ru.xlf
@@ -68,7 +68,7 @@ but received {4} argument(s), with types '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Время ожидания '{0}' истекло через {1}мс
@@ -419,7 +419,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Проверка '{0}' отменена
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.tr.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.tr.xlf
index a6b0023ad7..255dbab729 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.tr.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.tr.xlf
@@ -68,7 +68,7 @@ ancak, '{5}' türüyle {4} argüman aldı.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ Test '{0}' ms sonra zaman aşımına {1}oldu
@@ -419,7 +419,7 @@ Hata: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ Test '{0}' iptal edildi
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hans.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hans.xlf
index cb61f67d73..c8617c0588 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hans.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hans.xlf
@@ -68,7 +68,7 @@ but received {4} argument(s), with types '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ 测试 '{0}' 在 {1}毫秒后超时
@@ -419,7 +419,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ 测试 '{0}' 已取消
diff --git a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hant.xlf b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hant.xlf
index 1e49c6e342..6943b4e708 100644
--- a/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hant.xlf
+++ b/src/Adapter/MSTest.TestAdapter/Resources/xlf/Resource.zh-Hant.xlf
@@ -68,7 +68,7 @@ but received {4} argument(s), with types '{5}'.
Test '{0}' timed out after {1}ms
- Test '{0}' timed out after {1}ms
+ 測試 '{0}' 在 {1}毫秒後逾時
@@ -419,7 +419,7 @@ Error: {1}
Test '{0}' was canceled
- Test '{0}' was canceled
+ 已取消測試 '{0}'
diff --git a/src/Analyzers/MSTest.Analyzers/AssemblyCleanupShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/AssemblyCleanupShouldBeValidAnalyzer.cs
index 0152e94b5d..39a385b64c 100644
--- a/src/Analyzers/MSTest.Analyzers/AssemblyCleanupShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/AssemblyCleanupShouldBeValidAnalyzer.cs
@@ -61,7 +61,7 @@ private static void AnalyzeSymbol(
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (!methodSymbol.IsAssemblyCleanupMethod(assemblyCleanupAttributeSymbol))
+ if (!methodSymbol.HasAttribute(assemblyCleanupAttributeSymbol))
{
return;
}
diff --git a/src/Analyzers/MSTest.Analyzers/AssemblyInitializeShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/AssemblyInitializeShouldBeValidAnalyzer.cs
index 2e7ac95c28..79268d60c0 100644
--- a/src/Analyzers/MSTest.Analyzers/AssemblyInitializeShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/AssemblyInitializeShouldBeValidAnalyzer.cs
@@ -55,7 +55,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (methodSymbol.IsAssemblyInitializeMethod(assemblyInitializeAttributeSymbol)
+ if (methodSymbol.HasAttribute(assemblyInitializeAttributeSymbol)
&& !methodSymbol.HasValidFixtureMethodSignature(taskSymbol, valueTaskSymbol, canDiscoverInternals, shouldBeStatic: true,
allowGenericType: false, FixtureParameterMode.MustHaveTestContext, testContextSymbol, testClassAttributeSymbol, fixtureAllowInheritedTestClass: false, out bool isFixable))
{
diff --git a/src/Analyzers/MSTest.Analyzers/ClassCleanupShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/ClassCleanupShouldBeValidAnalyzer.cs
index 9137406b6b..0e693f68dc 100644
--- a/src/Analyzers/MSTest.Analyzers/ClassCleanupShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/ClassCleanupShouldBeValidAnalyzer.cs
@@ -63,7 +63,7 @@ private static void AnalyzeSymbol(
{
var methodSymbol = (IMethodSymbol)context.Symbol;
bool isInheritanceModeSet = methodSymbol.IsInheritanceModeSet(inheritanceBehaviorSymbol, classCleanupAttributeSymbol);
- if (methodSymbol.IsClassInitializeMethod(classCleanupAttributeSymbol)
+ if (methodSymbol.HasAttribute(classCleanupAttributeSymbol)
&& (!methodSymbol.HasValidFixtureMethodSignature(taskSymbol, valueTaskSymbol, canDiscoverInternals, shouldBeStatic: true,
allowGenericType: isInheritanceModeSet, FixtureParameterMode.OptionalTestContext, testContextSymbol,
testClassAttributeSymbol, fixtureAllowInheritedTestClass: true, out bool isFixable)
diff --git a/src/Analyzers/MSTest.Analyzers/ClassInitializeShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/ClassInitializeShouldBeValidAnalyzer.cs
index 0ef72850a0..88181fb2f3 100644
--- a/src/Analyzers/MSTest.Analyzers/ClassInitializeShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/ClassInitializeShouldBeValidAnalyzer.cs
@@ -59,7 +59,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
{
var methodSymbol = (IMethodSymbol)context.Symbol;
bool isInheritanceModeSet = methodSymbol.IsInheritanceModeSet(inheritanceBehaviorSymbol, classInitializeAttributeSymbol);
- if (methodSymbol.IsClassInitializeMethod(classInitializeAttributeSymbol)
+ if (methodSymbol.HasAttribute(classInitializeAttributeSymbol)
&& ((!methodSymbol.HasValidFixtureMethodSignature(taskSymbol, valueTaskSymbol, canDiscoverInternals, shouldBeStatic: true,
allowGenericType: isInheritanceModeSet, FixtureParameterMode.MustHaveTestContext, testContextSymbol,
testClassAttributeSymbol, fixtureAllowInheritedTestClass: true, out bool isFixable))
diff --git a/src/Analyzers/MSTest.Analyzers/Helpers/FixtureUtils.cs b/src/Analyzers/MSTest.Analyzers/Helpers/FixtureUtils.cs
index 66353d82a6..d4846ee54e 100644
--- a/src/Analyzers/MSTest.Analyzers/Helpers/FixtureUtils.cs
+++ b/src/Analyzers/MSTest.Analyzers/Helpers/FixtureUtils.cs
@@ -12,24 +12,6 @@ namespace MSTest.Analyzers.Helpers;
internal static class FixtureUtils
{
- public static bool IsAssemblyInitializeMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol assemblyInitializeAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, assemblyInitializeAttributeSymbol));
-
- public static bool IsAssemblyCleanupMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol assemblyCleanupAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, assemblyCleanupAttributeSymbol));
-
- public static bool IsClassInitializeMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol classInitializeAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, classInitializeAttributeSymbol));
-
- public static bool IsClassCleanupMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol classCleanupAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, classCleanupAttributeSymbol));
-
- public static bool IsTestInitializeMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol testInitializeAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, testInitializeAttributeSymbol));
-
- public static bool IsTestCleanupMethod(this IMethodSymbol methodSymbol, INamedTypeSymbol testCleanupAttributeSymbol)
- => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, testCleanupAttributeSymbol));
-
public static bool HasValidFixtureMethodSignature(this IMethodSymbol methodSymbol, INamedTypeSymbol? taskSymbol,
INamedTypeSymbol? valueTaskSymbol, bool canDiscoverInternals, bool shouldBeStatic, bool allowGenericType,
FixtureParameterMode fixtureParameterMode,
diff --git a/src/Analyzers/MSTest.Analyzers/Helpers/IMethodSymbolExtensions.cs b/src/Analyzers/MSTest.Analyzers/Helpers/IMethodSymbolExtensions.cs
index 6d58c445e5..4ae6b7faff 100644
--- a/src/Analyzers/MSTest.Analyzers/Helpers/IMethodSymbolExtensions.cs
+++ b/src/Analyzers/MSTest.Analyzers/Helpers/IMethodSymbolExtensions.cs
@@ -9,6 +9,9 @@ namespace MSTest.Analyzers.Helpers;
internal static class IMethodSymbolExtensions
{
+ public static bool HasAttribute(this IMethodSymbol methodSymbol, INamedTypeSymbol attribute)
+ => methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, attribute));
+
public static bool IsPublicAndHasCorrectResultantVisibility(this IMethodSymbol methodSymbol, bool canDiscoverInternals)
{
// Even when we allow discovering internals, MSTest engine only supports the method being declared as public.
diff --git a/src/Analyzers/MSTest.Analyzers/PreferConstructorOverTestInitializeAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/PreferConstructorOverTestInitializeAnalyzer.cs
index 61d03d2294..5895772f5d 100644
--- a/src/Analyzers/MSTest.Analyzers/PreferConstructorOverTestInitializeAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/PreferConstructorOverTestInitializeAnalyzer.cs
@@ -51,7 +51,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (methodSymbol.IsTestInitializeMethod(testInitAttributeSymbol) && methodSymbol.ReturnsVoid)
+ if (methodSymbol.HasAttribute(testInitAttributeSymbol) && methodSymbol.ReturnsVoid)
{
context.ReportDiagnostic(methodSymbol.CreateDiagnostic(Rule));
}
diff --git a/src/Analyzers/MSTest.Analyzers/PreferDisposeOverTestCleanupAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/PreferDisposeOverTestCleanupAnalyzer.cs
index 404d4cf7ca..fa126178e5 100644
--- a/src/Analyzers/MSTest.Analyzers/PreferDisposeOverTestCleanupAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/PreferDisposeOverTestCleanupAnalyzer.cs
@@ -53,7 +53,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (methodSymbol.IsTestCleanupMethod(testCleanupAttributeSymbol))
+ if (methodSymbol.HasAttribute(testCleanupAttributeSymbol))
{
// We want to report only if the TestCleanup method returns void or if IAsyncDisposable is available.
if (iasyncDisposableSymbol is not null
diff --git a/src/Analyzers/MSTest.Analyzers/TestCleanupShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/TestCleanupShouldBeValidAnalyzer.cs
index e6efcf42ca..e6f4ea8199 100644
--- a/src/Analyzers/MSTest.Analyzers/TestCleanupShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/TestCleanupShouldBeValidAnalyzer.cs
@@ -53,7 +53,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
INamedTypeSymbol? valueTaskSymbol, INamedTypeSymbol testClassAttributeSymbol, bool canDiscoverInternals)
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (methodSymbol.IsTestCleanupMethod(testCleanupAttributeSymbol)
+ if (methodSymbol.HasAttribute(testCleanupAttributeSymbol)
&& !methodSymbol.HasValidFixtureMethodSignature(taskSymbol, valueTaskSymbol, canDiscoverInternals, shouldBeStatic: false,
allowGenericType: true, FixtureParameterMode.MustNotHaveTestContext, testContextSymbol: null, testClassAttributeSymbol, fixtureAllowInheritedTestClass: true, out bool isFixable))
{
diff --git a/src/Analyzers/MSTest.Analyzers/TestInitializeShouldBeValidAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/TestInitializeShouldBeValidAnalyzer.cs
index de98ece3e0..559d7e39b4 100644
--- a/src/Analyzers/MSTest.Analyzers/TestInitializeShouldBeValidAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/TestInitializeShouldBeValidAnalyzer.cs
@@ -53,7 +53,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbo
INamedTypeSymbol? valueTaskSymbol, INamedTypeSymbol testClassAttributeSymbol, bool canDiscoverInternals)
{
var methodSymbol = (IMethodSymbol)context.Symbol;
- if (methodSymbol.IsTestInitializeMethod(testInitializeAttributeSymbol)
+ if (methodSymbol.HasAttribute(testInitializeAttributeSymbol)
&& !methodSymbol.HasValidFixtureMethodSignature(taskSymbol, valueTaskSymbol, canDiscoverInternals, shouldBeStatic: false,
allowGenericType: true, FixtureParameterMode.MustNotHaveTestContext, testContextSymbol: null, testClassAttributeSymbol, fixtureAllowInheritedTestClass: true, out bool isFixable))
{
diff --git a/src/Analyzers/MSTest.Analyzers/UseParallelizeAttributeAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/UseParallelizeAttributeAnalyzer.cs
index b3295b921e..f9bccc3686 100644
--- a/src/Analyzers/MSTest.Analyzers/UseParallelizeAttributeAnalyzer.cs
+++ b/src/Analyzers/MSTest.Analyzers/UseParallelizeAttributeAnalyzer.cs
@@ -44,6 +44,13 @@ public override void Initialize(AnalysisContext context)
private static void AnalyzeCompilation(CompilationAnalysisContext context)
{
+ bool hasTestAdapter = context.Compilation.ReferencedAssemblyNames.Any(asm => asm.Name == "Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter");
+ if (!hasTestAdapter)
+ {
+ // We shouldn't produce a diagnostic if only the test framework is referenced, but not the adapter.
+ return;
+ }
+
INamedTypeSymbol? parallelizeAttributeSymbol = context.Compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.MicrosoftVisualStudioTestToolsUnitTestingParallelizeAttribute);
INamedTypeSymbol? doNotParallelizeAttributeSymbol = context.Compilation.GetOrCreateTypeByMetadataName(WellKnownTypeNames.MicrosoftVisualStudioTestToolsUnitTestingDoNotParallelizeAttribute);
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf
index c79e88f0d6..c00244ab27 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Aby byly metody s označením [AssemblyCleanup] platné, musí se řídit následujícím rozložením:
+– Nesmí být deklarované pro obecnou třídu.
+– Musí být public.
+– Musí být static.
+– Nesmí být async void.
+– Nesmí být speciální metodou (finalizační metoda, operátor...).
+– Nesmí být obecné.
+– Nesmí přijímat žádný parametr, nebo musí přijímat jediný parametr typu TestContext.
+– Návratový typ musí být void, Task nebo ValueTask.
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Typ deklarující tyto metody by měl také respektovat následující pravidla:
+– Typ by měl být třída.
+– Třída by měla být public nebo internal (pokud testovací projekt používá atribut [DiscoverInternals]).
+– Třída by neměla být static.
+– Třída by měla být označena atributem [TestClass] (nebo odvozeným atributem).
+– Třída by neměla být obecná.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Aby byly metody s označením [ClassCleanup] platné, musí se řídit následujícím rozložením:
+– Nesmí být deklarované pro obecnou třídu bez nastavení režimu InheritanceBehavior.
+– Musí být public.
+– Musí být static.
+– Nesmí být async void.
+– Nesmí být speciální metodou (finalizační metoda, operátor...).
+– Nesmí být obecné.
+– Nesmí přijímat žádný parametr, nebo musí přijímat jediný parametr typu TestContext.
+– Návratový typ musí být void, Task nebo ValueTask.
+– V případě třídy abstract by měl být zadán parametr atributu InheritanceBehavior.BeforeEachDerivedClass.
+– V případě třídy sealed by neměl být zadán parametr atributu InheritanceBehavior.BeforeEachDerivedClass.
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Typ deklarující tyto metody by měl také respektovat následující pravidla:
+– Typ by měl být třída.
+– Třída by měla být public nebo internal (pokud testovací projekt používá atribut [DiscoverInternals]).
+– Třída by neměla být static.
+– Pokud je třída sealed, měla by být označena atributem [TestClass] (nebo odvozeným atributem).
+– Třída by neměla být obecná.
@@ -379,7 +379,7 @@ Typ deklarující tyto metody by měl také respektovat následující pravidla:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ Člen [DynamicData] {0}.{1} byl nalezen více než jednou.
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf
index 7aaa0f678d..1096835671 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Methoden, die mit „[AssemblyCleanup]“ gekennzeichnet sind, müssen dem folgenden Layout folgen, um gültig zu sein:
+– kann nicht für eine generische Klasse deklariert werden
+– muss „public“ sein
+– muss „static“ sein
+– darf nicht „async void“ sein
+– darf keine spezielle Methode sein (Finalizer, Operator...)
+– darf nicht „generic“ sein
+– sollte entweder keinen Parameter oder einen einzelnen Parameter vom Typ „TestContext“ verwenden
+– der Rückgabetyp muss „void“, „Task“ oder „ValueTask“ sein
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Der Typ, der diese Methoden deklariert, sollte auch die folgenden Regeln beachten:
+– Der Typ sollte eine Klasse sein
+– Die Klasse muss „public“ oder „internal“ sein (wenn das Testprojekt das Attribut „[DiscoverInternals]“ verwendet)
+– Die Klasse darf nicht „static“ sein
+– Die Klasse muss mit „[TestClass]“ (oder einem abgeleiteten Attribut) markiert werden
+- die Klasse darf nicht generisch sein.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Methoden, die mit „[ClassCleanup]“ gekennzeichnet sind, müssen dem folgenden Layout folgen, um gültig zu sein:
+– kann nicht für eine generische Klasse deklariert werden, ohne dass der Modus „InheritanceBehavior“ festgelegt ist
+– muss „public“ sein
+– muss „static“ sein
+– darf nicht „async void“ sein
+– darf keine spezielle Methode sein (Finalizer, Operator...)
+– darf nicht „generic“ sein
+– sollte entweder keinen Parameter oder einen einzelnen Parameter vom Typ „TestContext“ verwenden
+– der Rückgabetyp muss „void“, „Task“ oder „ValueTask“ sein
+– der Attributparameter „InheritanceBehavior.BeforeEachDerivedClass“ sollte angegeben werden, wenn die Klasse „abstract“ ist
+– der Attributparameter „InheritanceBehavior.BeforeEachDerivedClass“ sollte angegeben werden, wenn die Klasse „sealed“ ist
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Der Typ, der diese Methoden deklariert, sollte auch die folgenden Regeln beachten:
+– Der Typ sollte eine Klasse sein
+– Die Klasse muss „public“ oder „internal“ sein (wenn das Testprojekt das Attribut „[DiscoverInternals]“ verwendet)
+– Die Klasse darf nicht „static“ sein
+– Wenn die Klasse „sealed“ ist, sollte sie mit „[TestClass]“ (oder einem abgeleiteten Attribut) markiert werden
+- die Klasse darf nicht generisch sein.
@@ -380,7 +380,7 @@ Der Typ, der diese Methoden deklariert, sollte auch die folgenden Regeln beachte
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ „[DynamicData]“-Mitglied „{0}.{1}“ wurde mehrmals gefunden.
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf
index 6fbe5e76f5..0df0f975dd 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Los métodos marcados con '[AssemblyCleanup]' deben seguir el siguiente diseño para ser válidos:
+-no se puede declarar en una clase genérica
+- debería ser 'público'
+- debería estar 'estático'
+-no debe ser 'async void'
+-no debe ser un método especial (finalizador, operador...).
+-no debe ser genérico
+-no debe tomar ningún parámetro o tomar un único parámetro de tipo 'TestContext'
+- El tipo de valor devuelto debe ser 'void', 'Task' o 'ValueTask'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+El tipo que declara estos métodos también debe respetar las reglas siguientes:
+-El tipo debe ser una clase
+-La clase debe ser 'public' o 'internal' (si el proyecto de prueba usa el atributo '[DiscoverInternals]')
+-La clase no debe ser 'static'
+-La clase debe marcarse con '[TestClass]' (o un atributo derivado)
+-la clase no debe ser genérica.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Los métodos marcados con '[ClassCleanup]' deben seguir el siguiente diseño para ser válidos:
+-no se puede declarar en una clase genérica sin el modo 'InheritanceBehavior' establecido
+- debería ser 'público'
+- debería estar 'estático'
+-no debe ser 'async void'
+-no debe ser un método especial (finalizador, operador...).
+-no debe ser genérico
+-no debe tomar ningún parámetro o tomar un único parámetro de tipo 'TestContext'
+- El tipo de valor devuelto debe ser 'void', 'Task' o 'ValueTask'
+Se debe especificar el parámetro de atributo -'InheritanceBehavior.BeforeEachDerivedClass' si la clase es 'abstract'
+No se debe especificar el parámetro de atributo -'InheritanceBehavior.BeforeEachDerivedClass' si la clase es 'sealed'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+El tipo que declara estos métodos también debe respetar las reglas siguientes:
+-El tipo debe ser una clase
+-La clase debe ser 'public' o 'internal' (si el proyecto de prueba usa el atributo '[DiscoverInternals]')
+-La clase no debe ser 'static'
+-Si la clase es 'sealed', debe marcarse con '[TestClass]' (o un atributo derivado)
+-la clase no debe ser genérica.
@@ -379,7 +379,7 @@ El tipo que declara estos métodos también debe respetar las reglas siguientes:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' miembro '{0}.{1}' se encuentra más de una vez
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf
index d31fd65b76..a35f7d47a4 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Les méthodes marquées par « [AssemblyCleanup] » doivent respecter le schéma suivant pour être valides :
+-il ne peut pas être déclarée dans une classe générique
+– il doit être « public »
+– il doit être « static »
+– il ne doit pas être « async void »
+– Il ne doit pas s’agir d’une méthode spéciale (finaliseur, opérateur...).
+– il ne doit pas être générique
+- il ne doit pas prendre de paramètre ou prendre un seul paramètre de type 'TestContext'
+- le type de retour doit être « vide », « Task » ou « ValueTask »
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Le type déclarant ces méthodes doit également respecter les règles suivantes :
+Le type doit être une classe
+-La classe doit être « public » ou « internal » (si le projet de test utilise l’attribut ’[DiscoverInternals]’)
+-La classe ne doit pas être» ’static »
+-La classe doit être marquée par « [TestClass] » (ou un attribut dérivé)
+-la classe ne doit pas être générique.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Les méthodes marquées par « [ClassCleanup] » doivent respecter le schéma suivant pour être valides :
+-il ne peut pas être déclarée dans une classe générique si le mode ’InheritanceBehavior’ n’est pas activé
+– il doit être « public »
+– il doit être « static »
+– il ne doit pas être « async void »
+– Il ne doit pas s’agir d’une méthode spéciale (finaliseur, opérateur...).
+– il ne doit pas être générique
+- il ne doit pas prendre de paramètre ou prendre un seul paramètre de type 'TestContext'
+- le type de retour doit être « vide », « Task » ou « ValueTask »
+- « InheritanceBehavior.BeforeEachDerivedClass » doit être spécifié si la classe est « abstract »
+-Le paramètre d’attribut « InheritanceBehavior.BeforeEachDerivedClass » ne doit pas être spécifié si la classe est « scellée »
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Le type déclarant ces méthodes doit également respecter les règles suivantes :
+Le type doit être une classe
+-La classe doit être « public » ou « internal » (si le projet de test utilise l’attribut ’[DiscoverInternals]’)
+-La classe ne doit pas être « static »
+-Si la classe est « sealed », elle doit être marquée avec « [TestClass] » (ou un attribut dérivé)
+-la classe ne doit pas être générique.
@@ -379,7 +379,7 @@ Le type doit être une classe
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' membre ' {0}.{1}' est trouvé plusieurs fois
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf
index ab85a55c21..5673cca759 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ I metodi contrassegnati con ‘[AssemblyCleanup]' devono seguire il layout seguente per essere validi:
+-Non può essere dichiarato in una classe generica
+- Deve essere 'public'
+- Deve essere 'static'
+- Non deve essere 'async void'
+- Non deve essere un metodo speciale (finalizzatore, operatore...).
+- Non deve essere generico
+- Non deve accettare alcun parametro o accettare un singolo parametro di tipo 'TestContext'
+- il tipo restituito deve essere 'void', 'Task' o 'ValueTask'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Anche il tipo che dichiara questi metodi deve rispettare le regole seguenti:
+-Il tipo deve essere una classe
+-La classe deve essere 'public' o 'internal' (se il progetto di test usa l'attributo '[DiscoverInternals]')
+-La classe non deve essere 'static'
+-La classe deve essere contrassegnata con '[TestClass]' (o un attributo derivato)
+-La classe non deve essere generica.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ I metodi contrassegnati con ‘[ClassCleanup]' devono seguire il layout seguente per essere validi:
+-Non può essere dichiarato in una classe generica se la modalità 'InheritanceBehavior' non è impostata
+- Deve essere 'public'
+- Deve essere 'static'
+- Non deve essere 'async void'
+- Non deve essere un metodo speciale (finalizzatore, operatore...).
+- Non deve essere generico
+- Non deve accettare alcun parametro o accettare un singolo parametro di tipo 'TestContext'
+- il tipo restituito deve essere 'void', 'Task' o 'ValueTask'
+- È necessario specificare il parametro dell'attributo 'InheritanceBehavior.BeforeEachDerivedClass' se la classe è 'abstract'
+- Non è necessario specificare il parametro dell'attributo 'InheritanceBehavior.BeforeEachDerivedClass' se la classe è 'sealed'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Anche il tipo che dichiara questi metodi deve rispettare le regole seguenti:
+-Il tipo deve essere una classe
+-La classe deve essere 'public' o 'internal' (se il progetto di test usa l'attributo '[DiscoverInternals]')
+-La classe non deve essere 'static'
+-Se la classe è 'sealed', deve essere contrassegnata con '[TestClass]' (o un attributo derivato)
+-La classe non deve essere generica.
@@ -379,7 +379,7 @@ Anche il tipo che dichiara questi metodi deve rispettare le regole seguenti:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ Il membro '[DynamicData]' '{0}.{1}' è stato trovato più di una volta
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf
index 7b9f8b38db..0ff2e8bd4f 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ '[AssemblyCleanup]' でマークされたメソッドを有効にするには、次のレイアウトに従う必要があります:
+- ジェネリック クラスで宣言することはできません
+- 'public' である必要があります
+- 'static' である必要があります
+- 'async void' にすることはできません
+- 特殊なメソッド (ファイナライザー、演算子...) にすることはできません。
+- ジェネリックにすることはできません
+- パラメーターを受け取らないか、'TestContext' 型の 1 つのパラメーターを受け取る必要があります
+- 戻り値の型が 'void'、'Task'、または 'ValueTask' である必要があります
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+これらのメソッドを宣言する型も、次の規則に従う必要があります:
+- 型はクラスである必要があります
+- クラスは 'public' または 'internal' である必要があります (テスト プロジェクトが '[DiscoverInternals]' 属性を使用している場合)
+- クラスを 'static' にすることはできません
+- クラスは '[TestClass]' (または派生属性) でマークする必要があります
+- クラスをジェネリックにすることはできません。
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ '[ClassCleanup]' でマークされたメソッドを有効にするには、次のレイアウトに従う必要があります:
+- 'InheritanceBehavior' モードが設定されていないと、ジェネリック クラスで宣言できません
+- 'public' である必要があります
+- 'static' である必要があります
+- 'async void' にすることはできません
+- 特殊なメソッド (ファイナライザー、演算子...) にすることはできません。
+- ジェネリックにすることはできません
+- パラメーターを受け取らないか、'TestContext' 型の 1 つのパラメーターを受け取る必要があります
+- 戻り値の型が 'void'、'Task'、または 'ValueTask' である必要があります
+- クラスが 'abstract' である場合は 'InheritanceBehavior.BeforeEachDerivedClass' 属性パラメーターを指定する必要があります
+- クラスが 'sealed' である場合は 'InheritanceBehavior.BeforeEachDerivedClass' 属性パラメーターを指定しない必要があります
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+これらのメソッドを宣言する型も、次の規則に従う必要があります:
+- 型はクラスである必要があります
+- クラスは 'public' または 'internal' である必要があります (テスト プロジェクトが '[DiscoverInternals]' 属性を使用している場合)
+- クラスを 'static' にすることはできません
+- クラスが 'sealed' の場合は、'[TestClass]' (または派生属性) でマークする必要があります
+- クラスをジェネリックにすることはできません。
@@ -379,7 +379,7 @@ The type declaring these methods should also respect the following rules:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' メンバー '{0}.{1}' が複数回見つかりました
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf
index b191882072..1ae3a6c497 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ '[AssemblyCleanup]'으로 표시된 메서드가 유효하려면 다음 레이아웃을 따라야 합니다.
+- 제네릭 클래스에서 선언할 수 없습니다.
+- 'public'이어야 합니다.
+- 'static'이어야 합니다.
+- 'async void'가 아니어야 합니다.
+- 특수 메서드(종료자, 연산자...)가 아니어야 합니다.
+- 제네릭이 아니어야 합니다.
+- 매개 변수를 사용하거나 'TestContext' 형식의 단일 매개 변수를 사용해서는 안 됩니다.
+- 반환 형식은 'void', 'Task' 또는 'ValueTask'여야 합니다.
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+이러한 메서드를 선언하는 형식은 다음 규칙도 준수해야 합니다.
+- 형식은 클래스여야 합니다.
+- 클래스는 'public' 또는 'internal'이어야 합니다(테스트 프로젝트에서 '[DiscoverInternals]' 특성을 사용하는 경우).
+- 클래스는 'static'이 되어서는 안 됩니다.
+- 클래스는 '[TestClass]'(또는 파생 특성)로 표시되어야 합니다.
+- 클래스는 제네릭이 아니어야 합니다.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ '[ClassCleanup]'으로 표시된 메서드가 유효하려면 다음 레이아웃을 따라야 합니다.
+- 'InheritanceBehavior' 모드가 설정되지 않은 제네릭 클래스에서 선언할 수 없습니다.
+- 'public'이어야 합니다.
+- 'static'이어야 합니다.
+- 'async void'가 아니어야 합니다.
+- 특수 메서드(종료자, 연산자...)가 아니어야 합니다.
+- 제네릭이 아니어야 합니다.
+- 매개 변수를 사용하거나 'TestContext' 형식의 단일 매개 변수를 사용해서는 안 됩니다.
+- 반환 형식은 'void', 'Task' 또는 'ValueTask'여야 합니다.
+- 클래스가 'abstract'인 경우 'InheritanceBehavior.BeforeEachDerivedClass' 특성 매개 변수를 지정해야 합니다.
+- 클래스가 'sealed'인 경우 'InheritanceBehavior.BeforeEachDerivedClass' 특성 매개 변수를 지정하면 안 됩니다.
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+이러한 메서드를 선언하는 형식은 다음 규칙도 준수해야 합니다.
+- 형식은 클래스여야 합니다.
+- 클래스는 'public' 또는 'internal'이어야 합니다(테스트 프로젝트에서 '[DiscoverInternals]' 특성을 사용하는 경우).
+- 클래스는 'static'이 되어서는 안 됩니다.
+- 클래스가 'sealed'인 경우 '[TestClass]'(또는 파생 특성)로 표시되어야 합니다.
+- 클래스는 제네릭이 아니어야 합니다.
@@ -379,7 +379,7 @@ The type declaring these methods should also respect the following rules:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' 멤버 '{0}.{1}'을(를) 두 번 이상 찾았습니다.
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf
index 076f2f56d1..73ec8d0837 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Metody oznaczone za pomocą „[AssemblyCleanup]” powinny być zgodne z następującym układem, aby były prawidłowe:
+— nie może być zadeklarowana w klasie ogólnej
+— powinna być typu „public”
+— powinna mieć wartość „static”
+— nie powinna to być wartość „async void”
+— nie powinna to być metoda specjalna (finalizator, operator...).
+— nie powinna być ogólna
+— nie powinien przyjmować żadnego parametru lub przyjmować pojedynczego parametru typu „TestContext”
+— zwracany typ powinien mieć wartość „void”, „Taks” lub „ValueTask”
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Typ deklarujący te metody powinien również przestrzegać następujących reguł:
+— typ powinien być klasą
+— klasa powinna mieć wartość „public” lub „internal” (jeśli projekt testowy używa atrybutu „[DiscoverInternals]”)
+— klasa nie powinna mieć wartości „static”
+— klasa powinna być oznaczona „[TestClass]” (lub atrybutem pochodnym)
+— klasa nie powinna być ogólna.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Metody oznaczone za pomocą „[ClassCleanup]” powinny być zgodne z następującym układem, aby były prawidłowe:
+— nie może być zadeklarowana w klasie ogólnej bez ustawionego trybu „InheritanceBehavior”
+— powinna być typu „public”
+— powinna mieć wartość „static”
+— nie powinna to być wartość „async void”
+— nie powinna to być metoda specjalna (finalizator, operator...).
+— nie powinna być ogólna
+— nie powinien przyjmować żadnego parametru lub przyjmować pojedynczego parametru typu „TestContext”
+— zwracany typ powinien mieć wartość „void”, „Taks” lub „ValueTask”
+— parametr atrybutu „InheritanceBehavior.BeforeEachDerivedClass” powinien być określony, jeśli klasa ma wartość „abstract”
+— parametr atrybutu „InheritanceBehavior.BeforeEachDerivedClass” nie powinien być określony, jeśli klasa ma wartość „sealed”
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Typ deklarujący te metody powinien również przestrzegać następujących reguł:
+— typ powinien być klasą
+— klasa powinna mieć wartość „public” lub „internal” (jeśli projekt testowy używa atrybutu „[DiscoverInternals]”)
+— klasa nie powinna mieć wartości „static”
+— jeśli klasa ma wartość „sealed”, powinna być oznaczona za pomocą „[TestClass]” (lub atrybutem pochodnym)
+— klasa nie powinna być ogólna.
@@ -379,7 +379,7 @@ Typ deklarujący te metody powinien również przestrzegać następujących regu
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ Element członkowski „[DynamicData]” „{0}.{1}” znaleziono więcej niż raz
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf
index 55e17fd899..31c0643151 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Os métodos marcados com '[AssemblyCleanup]' devem seguir o seguinte layout para serem válidos:
+-não pode ser declarado em uma classe genérica
+-deve ser 'public'
+-deve ser 'static'
+-não deve ser 'async void'
+-não deve ser um método especial (finalizador, operador...).
+-ele não deve ser genérico
+-ele não deve ter nenhum parâmetro ou usar um único parâmetro do tipo 'TestContext'
+-o tipo de retorno deve ser 'void', 'Task' ou 'ValueTask'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+O tipo declarando esses métodos também deve respeitar as seguintes regras:
+-O tipo deve ser uma classe
+-A classe deve ser 'public' ou 'internal' (se o projeto de teste estiver usando o '[DiscoverInternals]' atributo)
+-A classe não deve ser 'static'
+-A classe deve ser marcada com '[TestClass]' (ou um atributo derivado)
+-a classe não deve ser genérica.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Os métodos marcados com '[ClassCleanup]' devem seguir o seguinte layout para serem válidos:
+-não pode ser declarado em uma classe genérica sem que o modo 'InheritanceBehavior' esteja definido
+-deve ser 'public'
+-deve ser 'static'
+-não deve ser 'async void'
+-não deve ser um método especial (finalizador, operador...).
+-ele não deve ser genérico
+-ele não deve ter nenhum parâmetro ou usar um único parâmetro do tipo 'TestContext'
+-o tipo de retorno deve ser 'void', 'Task' ou 'ValueTask'
+O parâmetro de atributo -'InheritanceBehavior.BeforeEachDerivedClass' deve ser especificado se a classe for 'abstract'
+O parâmetro de atributo -'InheritanceBehavior.BeforeEachDerivedClass' não deve ser especificado se a classe for 'sealed'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+O tipo declarando esses métodos também deve respeitar as seguintes regras:
+-O tipo deve ser uma classe
+-A classe deve ser 'public' ou 'internal' (se o projeto de teste estiver usando o '[DiscoverInternals]' atributo)
+-A classe não deve ser 'static'
+-Se a classe for 'sealed', ela deverá ser marcada com '[TestClass]' (ou um atributo derivado)
+-a classe não deve ser genérica.
@@ -379,7 +379,7 @@ O tipo que declara esses métodos também deve respeitar as seguintes regras:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ O membro '[DynamicData]' '{0}.{1}' foi encontrado mais de uma vez
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf
index ee59f488cf..b9ce60a39d 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf
@@ -19,22 +19,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ Чтобы метод, помеченный "[AssemblyCleanup]", был допустимым, он должен соответствовать следующим правилам:
+– не может быть объявлен для универсального класса ("generic");
+– должен быть общедоступным ("public");
+– должен быть статическим ("static");
+– не должен быть асинхронным и не возвращающим значения ("async void")
+– не должен быть специальным (метод завершения, оператор…).
+– не должен быть общим ("generic")
+;
+– не должен принимать никаких параметров или должен принимать один параметр типа TestContext
+;
+– должен иметь тип возвращаемого значения "void", "Task" или "ValueTask";
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Тип, объявляющий такие методы, также должен соответствовать следующим правилам:
+– должен быть классом;
+– класс должен быть объявлен как "public" или "internal" (если тестовый проект использует атрибут "[DiscoverInternals]");
+– не должен быть статическим ("static");
+– должен быть помечен как "[TestClass]" (или производный атрибут);
+– не должен быть универсальным ("generic").
@@ -152,24 +154,26 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ Чтобы метод, помеченный "[ClassCleanup]", был допустимым, он должен соответствовать следующим правилам:
+– не может быть объявлен для универсального класса, если не установлен режим InheritanceBehavior;
+– должен быть общедоступным ("public");
+– должен быть статическим ("static");
+– не должен быть асинхронным и не возвращающим значения ("async void")
+– не должен быть специальным (метод завершения, оператор…).
+– не должен быть общим ("generic")
+;
+– не должен принимать никаких параметров или должен принимать один параметр типа TestContext
+;
+– должен иметь тип возвращаемого значения "void", "Task" или "ValueTask";
+– если класс абстрактный, должен быть указан параметр атрибута "InheritanceBehavior.BeforeEachDerivedClass";
+– если класс запечатанный, не следует указывать параметр атрибута "InheritanceBehavior.BeforeEachDerivedClass";
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Тип, объявляющий такие методы, также должен соответствовать следующим правилам:
+– должен быть классом;
+– класс должен быть объявлен как "public" или "internal" (если тестовый проект использует атрибут "[DiscoverInternals]");
+– не должен быть объявлен как статический ("static");
+– если класс запечатанный, его следует пометить как "[TestClass]" (или производный атрибут);
+– не должен быть универсальным ("generic").
@@ -381,7 +385,7 @@ The type declaring these methods should also respect the following rules:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ Элемент "[DynamicData]" "{0}.{1}" обнаружен несколько раз
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf
index 3791c4e8ad..a2552a12f6 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ '[AssemblyCleanup]' ile işaretlenen yöntemlerin geçerli olması için aşağıdaki düzeni takip etmesi gerekir:
+-genel bir sınıfta tanımlanamaz
+-'public' olmalıdır
+-'static' olmalıdır
+-'async void' olmamalıdır
+-özel bir metot (sonlandırıcı, işleç...) olmamalıdır.
+- genel olmamalıdır
+-herhangi bir parametre almamalı veya 'TestContext' türünde tek bir parametre almalıdır
+- dönüş türü 'void', 'Task' veya 'ValueTask' olmalıdır
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Bu metotları bildiren türün ayrıca aşağıdaki kurallara uyması gerekir:
+-Tür bir sınıf olmalıdır
+-Sınıf 'public' veya 'internal' olmalıdır (test projesi '[DiscoverInternals]' niteliğini kullanıyorsa)
+-Sınıf 'static' olmamalıdır
+-Sınıf '[TestClass]' (veya türetilmiş bir öznitelik) ile işaretlenmelidir
+-sınıf genel olmamalıdır.
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ '[ClassCleanup]' ile işaretlenen yöntemlerin geçerli olması için aşağıdaki düzeni takip etmesi gereklidir:
+-'InheritanceBehavior' modu ayarlanmadan genel bir sınıfta tanımlanamaz
+-'public' olmalıdır
+-'static' olmalıdır
+-'async void' olmamalıdır
+-özel bir metot (sonlandırıcı, işleç...) olmamalıdır.
+- genel olmamalıdır
+-herhangi bir parametre almamalı veya 'TestContext' türünde tek bir parametre almalıdır
+- dönüş türü 'void', 'Task' veya 'ValueTask' olmalıdır
+-Sınıf 'abstract' ise 'InheritanceBehavior.BeforeEachDerivedClass' öznitelik parametresi belirtilmelidir
+-'InheritanceBehavior.BeforeEachDerivedClass' öznitelik parametresi, sınıf 'sealed' ise belirtilmemelidir
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+Bu metotları bildiren türün ayrıca aşağıdaki kurallara uyması gerekir:
+-Tür bir sınıf olmalıdır
+-Sınıf 'public' veya 'internal' olmalıdır (test projesi '[DiscoverInternals]' niteliğini kullanıyorsa)
+-Sınıf 'static' olmamalıdır
+-Sınıf 'sealed' ise '[TestClass]' (veya türetilmiş bir öznitelik) ile işaretlenmelidir
+-sınıf genel olmamalıdır.
@@ -379,7 +379,7 @@ Bu yöntemleri bildiren tipin ayrıca aşağıdaki kurallara uyması gerekir:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' üyesi '{0}.{1}' birden çok kez bulundu
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf
index ad6f1bbac2..6fa047a137 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ 标记有“[AssemblyCleanup]”的方法应遵循以下布局才会有效:
+-不能在泛型类上声明它
+- 它应为“public”
+- 它应为“static”
+- 它不应为“async void”
+- 它不应是特殊方法(终结器、运算符...)。
+- 它不应是泛型的
+-它不应采用任何参数,或采用类型为“TestContext”的单个参数
+- 返回类型应为“void”、“Task”或“ValueTask”
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+声明这些方法的类型还应遵循以下规则:
+-类型应为类
+-类应为“public”或“internal”(如果测试项目正在使用“[DiscoverInternals]”属性)
+-类不应为“static”
+-应使用“[TestClass]”(或派生属性)标记类
+-类不应是泛型的。
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ 标记有“[ClassCleanup]”的方法应遵循以下布局才会有效:
+-如果未设置“InheritanceBehavior”模式,则不能在泛型类上声明它
+- 它应为“public”
+- 它应为“static”
+- 它不应为“async void”
+- 它不应是特殊方法(终结器、运算符...)。
+- 它不应是泛型的
+-它不应采用任何参数,或采用类型为“TestContext”的单个参数
+- 返回类型应为“void”、“Task”或“ValueTask”
+- "InheritanceBehavior.BeforeEachDerivedClass" 属性参数应在类为 "abstract" 时指定
+- "InheritanceBehavior.BeforeEachDerivedClass" 属性参数不应在类为 "sealed" 时指定
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+声明这些方法的类型还应遵循以下规则:
+-类型应为类
+-类应为“public”或“internal”(如果测试项目正在使用“[DiscoverInternals]”属性)
+-类不应为“static”
+-如果类为“sealed”,应使用“[TestClass]”(或派生属性)标记该类
+-类不应是泛型的。
@@ -379,7 +379,7 @@ The type declaring these methods should also respect the following rules:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ 多次找到 "[DynamicData]" 成员“{0}.{1}”
diff --git a/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf b/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf
index 954e70c12b..9251582b4d 100644
--- a/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf
+++ b/src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf
@@ -19,22 +19,22 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-The class should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[AssemblyCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
+ 標示為 '[AssemblyCleanup]' 的方法應該遵循下列配置才能有效:
+-其不能在泛型類別上宣告
+-其應為 'public'
+-其應為 'static'
+-其不應為 'async void'
+-其不應為特殊方法 (完成項、運算子...)。
+-其不應為泛型
+-其不應接受任何參數,或接受類型為 'TestContext' 的單一參數
+-傳回類型應為 'void'、'Task' 或 'ValueTask'
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--The class should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+宣告這些方法的類型還應遵循以下規則:
+-類型應為類別
+-類別應為 'public' 或 'internal' (如果測試專案使用 '[DiscoverInternals]' 屬性)
+-類別不應為 'static'
+-類別應標示為 '[TestClass]' (或衍生屬性)
+-類別不應為泛型。
@@ -151,24 +151,24 @@ The type declaring these methods should also respect the following rules:
-The class shouldn't be 'static'
-If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
-the class should not be generic.
- Methods marked with '[ClassCleanup]' should follow the following layout to be valid:
--it can't be declared on a generic class without the 'InheritanceBehavior' mode is set
--it should be 'public'
--it should be 'static'
--it should not be 'async void'
--it should not be a special method (finalizer, operator...).
--it should not be generic
--it should either not take any parameter, or take a single parameter of type 'TestContext'
--return type should be 'void', 'Task' or 'ValueTask'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should be specified if the class is 'abstract'
--'InheritanceBehavior.BeforeEachDerivedClass' attribute parameter should not be specified if the class is 'sealed'
+ 標示 '[ClassCleanup]' 的方法應該遵循下列配置,才會有效:
+-未設定 'InheritanceBehavior' 模式的情況下不能在泛型類別上宣告它
+-其應為 'public'
+-其應為 'static'
+-其不應為 'async void'
+-其不應為特殊方法 (完成項、運算子...)。
+-其不應為泛型
+-其不應接受任何參數,或接受類型為 'TestContext' 的單一參數
+-傳回類型應為 'void'、'Task' 或 'ValueTask'
+-如果類別為 'abstract',應指定 'InheritanceBehavior.BeforeEachDerivedClass' 屬性參數
+-如果類別為 'sealed',則不應指定 'InheritanceBehavior.BeforeEachDerivedClass' 屬性參數
-The type declaring these methods should also respect the following rules:
--The type should be a class
--The class should be 'public' or 'internal' (if the test project is using the '[DiscoverInternals]' attribute)
--The class shouldn't be 'static'
--If the class is 'sealed', it should be marked with '[TestClass]' (or a derived attribute)
--the class should not be generic.
+宣告這些方法的類型還應遵循以下規則:
+-類型應為類別
+-類別應為 'public' 或 'internal' (如果測試專案使用 '[DiscoverInternals]' 屬性)
+-類別不應為 'static'
+-如果類別是 'sealed',則應標示為 '[TestClass]' (或衍生屬性)
+-類別不應為泛型。
@@ -379,7 +379,7 @@ The type declaring these methods should also respect the following rules:
'[DynamicData]' member '{0}.{1}' is found more than once
- '[DynamicData]' member '{0}.{1}' is found more than once
+ '[DynamicData]' 成員 '{0}。{1}' 多次發現
diff --git a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/FilterOperator.cs b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/FilterOperator.cs
index 9743f49f87..d518d7548f 100644
--- a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/FilterOperator.cs
+++ b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/FilterOperator.cs
@@ -19,9 +19,4 @@ internal enum FilterOperator
/// Combine the following expressions with a logical OR.
///
Or,
-
- ///
- /// Filter the following expression by the given property.
- ///
- Equals,
}
diff --git a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/OperatorKind.cs b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/OperatorKind.cs
index 051583489c..b9c7da2819 100644
--- a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/OperatorKind.cs
+++ b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/OperatorKind.cs
@@ -41,6 +41,11 @@ internal enum OperatorKind
///
FilterEquals,
+ ///
+ /// Filter not equals operator.
+ ///
+ FilterNotEquals,
+
///
/// Operator used for combining multiple filters with a logical OR.
///
diff --git a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/TreeNodeFilter.cs b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/TreeNodeFilter.cs
index 5421aee941..9a81e683df 100644
--- a/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/TreeNodeFilter.cs
+++ b/src/Platform/Microsoft.Testing.Platform/Requests/TreeNodeFilter/TreeNodeFilter.cs
@@ -38,6 +38,7 @@ internal TreeNodeFilter(string filter)
/// FILTER_EXPR =
/// '(' FILTER_EXPR ')'
/// | TOKEN '=' TOKEN
+ /// | TOKEN '!=' TOKEN
/// | FILTER_EXPR OP FILTER_EXPR
/// | TOKEN
/// OP = '&' | '|'
@@ -210,6 +211,13 @@ private static List ParseFilter(string filter)
isPropAllowed = false;
break;
+ case "!=":
+ operatorStack.Push(OperatorKind.FilterNotEquals);
+
+ isOperatorAllowed = false;
+ isPropAllowed = false;
+ break;
+
default:
expressionStack.Push(new ValueExpression(token));
@@ -311,7 +319,6 @@ private static void ProcessStackOperator(OperatorKind op, Stack FilterOperator.And,
OperatorKind.Or => FilterOperator.Or,
- OperatorKind.FilterEquals => FilterOperator.Equals,
_ => throw ApplicationStateGuard.Unreachable(),
};
@@ -319,6 +326,7 @@ private static void ProcessStackOperator(OperatorKind op, Stack TokenizeFilter(string filter)
break;
+ case '!':
+ if (i + 1 < filter.Length && filter[i + 1] == '=')
+ {
+ if (lastStringTokenBuilder.Length > 0)
+ {
+ yield return lastStringTokenBuilder.ToString();
+ lastStringTokenBuilder.Clear();
+ }
+
+ yield return "!=";
+ i++;
+ }
+ else
+ {
+ goto default;
+ }
+
+ break;
+
default:
lastStringTokenBuilder.Append(Regex.Escape(filter[i].ToString()));
break;
@@ -441,7 +474,13 @@ public bool MatchesFilter(string testNodeFullPath, PropertyBag filterablePropert
if (currentFragmentIndex >= _filters.Count)
{
// Note: The regex for ** is .*.*, so we match against such a value expression.
- return currentFragmentIndex > 0 && _filters.Last() is ValueExpression { Value: ".*.*" };
+ FilterExpression lastFilter = _filters.Last();
+ if (lastFilter is ValueAndPropertyExpression valueAndPropertyExpression)
+ {
+ lastFilter = valueAndPropertyExpression.Value;
+ }
+
+ return currentFragmentIndex > 0 && lastFilter is ValueExpression { Value: ".*.*" };
}
if (!MatchFilterPattern(
diff --git a/src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs b/src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs
index defca4bcc5..2079f60160 100644
--- a/src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs
+++ b/src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs
@@ -561,20 +561,8 @@ public static void AreEqual(float expected, float actual, float delta, string? m
public static void AreEqual(float expected, float actual, float delta, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string? message,
params object?[]? parameters)
{
- if (float.IsNaN(expected) || float.IsNaN(actual) || float.IsNaN(delta))
- {
- string userMessage = BuildUserMessage(message, parameters);
- string finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- FrameworkMessages.AreEqualDeltaFailMsg,
- userMessage,
- expected.ToString(CultureInfo.CurrentCulture.NumberFormat),
- actual.ToString(CultureInfo.CurrentCulture.NumberFormat),
- delta.ToString(CultureInfo.CurrentCulture.NumberFormat));
- ThrowAssertFailed("Assert.AreEqual", finalMessage);
- }
-
- if (Math.Abs(expected - actual) > delta)
+ if (float.IsNaN(expected) || float.IsNaN(actual) || float.IsNaN(delta) ||
+ Math.Abs(expected - actual) > delta)
{
string userMessage = BuildUserMessage(message, parameters);
string finalMessage = string.Format(
@@ -1130,20 +1118,8 @@ public static void AreEqual(double expected, double actual, double delta, string
public static void AreEqual(double expected, double actual, double delta, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string? message,
params object?[]? parameters)
{
- if (double.IsNaN(expected) || double.IsNaN(actual) || double.IsNaN(delta))
- {
- string userMessage = BuildUserMessage(message, parameters);
- string finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- FrameworkMessages.AreEqualDeltaFailMsg,
- userMessage,
- expected.ToString(CultureInfo.CurrentCulture.NumberFormat),
- actual.ToString(CultureInfo.CurrentCulture.NumberFormat),
- delta.ToString(CultureInfo.CurrentCulture.NumberFormat));
- ThrowAssertFailed("Assert.AreEqual", finalMessage);
- }
-
- if (Math.Abs(expected - actual) > delta)
+ if (double.IsNaN(expected) || double.IsNaN(actual) || double.IsNaN(delta) ||
+ Math.Abs(expected - actual) > delta)
{
string userMessage = BuildUserMessage(message, parameters);
string finalMessage = string.Format(
diff --git a/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs b/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs
index 7dcf190ed1..8872cb744b 100644
--- a/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs
+++ b/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs
@@ -1,6 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Testing;
+using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;
+
using VerifyCS = MSTest.Analyzers.Test.CSharpCodeFixVerifier<
MSTest.Analyzers.UseParallelizeAttributeAnalyzer,
Microsoft.CodeAnalysis.Testing.EmptyCodeFixProvider>;
@@ -10,10 +14,30 @@ namespace MSTest.Analyzers.Test;
[TestClass]
public class UseParallelizeAttributeAnalyzerTests
{
+ private static async Task VerifyAsync(string code, bool includeTestAdapter, params DiagnosticResult[] expected)
+ {
+ var test = new VerifyCS.Test
+ {
+ TestCode = code,
+ };
+
+ if (includeTestAdapter)
+ {
+ // NOTE: Test constructor already adds TestFramework refs.
+ test.TestState.AdditionalReferences.Add(MetadataReference.CreateFromFile(typeof(MSTestExecutor).Assembly.Location));
+ }
+
+ test.ExpectedDiagnostics.AddRange(expected);
+ await test.RunAsync();
+ }
+
+ [TestMethod]
+ public async Task WhenNoAttributeSpecified_TestAdapterNotReferenced_NoDiagnostic()
+ => await VerifyAsync(string.Empty, includeTestAdapter: false);
+
[TestMethod]
- public async Task WhenNoAttributeSpecified_Diagnostic() => await VerifyCS.VerifyAnalyzerAsync(
- string.Empty,
- VerifyCS.Diagnostic(UseParallelizeAttributeAnalyzer.Rule).WithNoLocation());
+ public async Task WhenNoAttributeSpecified_TestAdapterReferenced_Diagnostic()
+ => await VerifyAsync(string.Empty, includeTestAdapter: true, VerifyCS.Diagnostic(UseParallelizeAttributeAnalyzer.Rule).WithNoLocation());
[TestMethod]
public async Task WhenParallelizeAttributeSet_NoDiagnostic()
@@ -24,7 +48,8 @@ public async Task WhenParallelizeAttributeSet_NoDiagnostic()
[assembly: Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)]
""";
- await VerifyCS.VerifyAnalyzerAsync(code);
+ await VerifyAsync(code, includeTestAdapter: true);
+ await VerifyAsync(code, includeTestAdapter: false);
}
[TestMethod]
@@ -36,6 +61,7 @@ public async Task WhenDoNotParallelizeAttributeSet_NoDiagnostic()
[assembly: DoNotParallelize]
""";
- await VerifyCS.VerifyAnalyzerAsync(code);
+ await VerifyAsync(code, includeTestAdapter: true);
+ await VerifyAsync(code, includeTestAdapter: false);
}
}
diff --git a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Requests/TreeNodeFilterTests.cs b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Requests/TreeNodeFilterTests.cs
index facd2f354b..f587f02457 100644
--- a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Requests/TreeNodeFilterTests.cs
+++ b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/Requests/TreeNodeFilterTests.cs
@@ -105,6 +105,42 @@ public void Parameters_PropertyCheck()
Assert.IsFalse(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag()));
}
+ [TestMethod]
+ public void Parameters_NegatedPropertyCheck()
+ {
+ TreeNodeFilter filter = new("/*.UnitTests[Tag!=Fast]");
+ Assert.IsFalse(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Fast"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Slow"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag()));
+ }
+
+ [TestMethod]
+ public void Parameters_NegatedPropertyCheckWithMatchAllFilter()
+ {
+ TreeNodeFilter filter = new("/**[Tag!=Fast]");
+ Assert.IsFalse(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Fast"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Slow"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag()));
+ }
+
+ [TestMethod]
+ public void Parameters_NegatedPropertyCheckCombinedWithAnd()
+ {
+ TreeNodeFilter filter = new("/*.UnitTests[(Tag!=Fast)&(Tag!=Slow)]");
+ Assert.IsFalse(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Fast"))));
+ Assert.IsFalse(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Slow"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag()));
+ }
+
+ [TestMethod]
+ public void Parameters_NegatedPropertyCheckCombinedWithOr()
+ {
+ TreeNodeFilter filter = new("/*.UnitTests[(Tag!=Fast)|(Tag!=Slow)]");
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Fast"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag(new KeyValuePairStringProperty("Tag", "Slow"))));
+ Assert.IsTrue(filter.MatchesFilter("/ProjectB.UnitTests", new PropertyBag()));
+ }
+
[TestMethod]
public void Parameters_DisallowAtStart()
=> Assert.ThrowsException(() => _ = new TreeNodeFilter("/[Tag=Fast]"));
@@ -167,4 +203,23 @@ public void PropertiesDoNotNeedUrlEncodingOfSlashes(string filter, string nodePa
Assert.IsFalse(filterInstance.MatchesFilter(nodePath, nodeProperties));
}
}
+
+ [TestMethod]
+ public void MatchAllFilterWithPropertyExpression()
+ {
+ TreeNodeFilter filter = new("/**[A=B]");
+ Assert.IsTrue(filter.MatchesFilter("/A/B/C/D", new PropertyBag(new KeyValuePairStringProperty("A", "B"))));
+ Assert.IsFalse(filter.MatchesFilter("/A/B/C/D", new PropertyBag(new KeyValuePairStringProperty("A", "C"))));
+ }
+
+ [TestMethod]
+ public void MatchAllFilterSubpathWithPropertyExpression()
+ {
+ TreeNodeFilter filter = new("/A/**[A=B]");
+ Assert.IsTrue(filter.MatchesFilter("/A/B/C/D", new PropertyBag(new KeyValuePairStringProperty("A", "B"))));
+ Assert.IsFalse(filter.MatchesFilter("/B/A/C/D", new PropertyBag(new KeyValuePairStringProperty("A", "B"))));
+ }
+
+ [TestMethod]
+ public void MatchAllFilterWithPropertyExpression_DoNotAllowInMiddleOfFilter() => Assert.ThrowsException(() => _ = new TreeNodeFilter("/**/Path[A=B]"));
}