Skip to content

Commit 2d2a310

Browse files
committed
Fix MSTest 4.0 analyzer errors
- MSTEST0001: Enable test parallelization at method level - MSTEST0044: Replace obsolete DataTestMethod with TestMethod (2 occurrences) MSTest 4.0 requires explicit parallelization configuration and no longer uses DataTestMethod - TestMethod with DataRow attributes is the new pattern.
1 parent 50f9073 commit 2d2a310

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

test/NosCore.Networking.Tests/LogLanguageTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public LogLanguageTests()
2727
}
2828

2929
[TestCategory("OPTIONAL-TEST")]
30-
[DataTestMethod]
30+
[TestMethod]
3131
[DataRow(RegionType.EN)]
3232
[DataRow(RegionType.CS)]
3333
[DataRow(RegionType.DE)]
@@ -51,7 +51,7 @@ public void CheckEveryLanguageValueSet(RegionType type)
5151
}
5252
}
5353

54-
[DataTestMethod]
54+
[TestMethod]
5555
[DataRow(RegionType.EN)]
5656
[DataRow(RegionType.CS)]
5757
[DataRow(RegionType.DE)]

test/NosCore.Networking.Tests/NosCore.Networking.Tests.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
<IsPackable>false</IsPackable>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.ParallelizeAttribute">
12+
<_Parameter1>Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.MethodLevel</_Parameter1>
13+
<_Parameter1_TypeName>Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope</_Parameter1_TypeName>
14+
</AssemblyAttribute>
15+
</ItemGroup>
916

1017
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
1118
<OutputPath>..\..\build\</OutputPath>

0 commit comments

Comments
 (0)