Skip to content

Commit 4c532de

Browse files
Refactored tests to use xUnit v3 and Microsoft Test Platform.
1 parent 4bc8d6a commit 4c532de

28 files changed

+250
-307
lines changed

Directory.Build.props

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@
4141

4242
<!--UNIT TESTS-->
4343
<PropertyGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.UnitTests'))">
44+
<OutputType>Exe</OutputType>
4445
<IsTestProject>true</IsTestProject>
4546
<IsPackable>false</IsPackable>
4647
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
48+
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
4749
</PropertyGroup>
4850

4951
<ItemGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.UnitTests'))">
50-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/>
51-
<PackageReference Include="xunit" Version="2.9.3"/>
52-
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5"/>
53-
<PackageReference Include="coverlet.collector" Version="6.0.4"/>
52+
<PackageReference Include="xunit.v3" Version="3.2.0"/>
5453
<Using Include="Xunit"/>
5554
</ItemGroup>
5655

@@ -62,9 +61,14 @@
6261
</PropertyGroup>
6362

6463
<ItemGroup Condition="$([System.String]::Copy('$(MSBuildProjectName)').EndsWith('.UnitTests.Data'))">
65-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/>
66-
<PackageReference Include="xunit" Version="2.9.3"/>
64+
<PackageReference Include="xunit.v3.extensibility.core" Version="3.2.0"/>
65+
<Using Include="System"/>
66+
<Using Include="System.Collections.Generic"/>
67+
<Using Include="System.Reflection"/>
68+
<Using Include="System.Threading.Tasks"/>
6769
<Using Include="Xunit"/>
70+
<Using Include="Xunit.Sdk"/>
71+
<Using Include="Xunit.v3"/>
6872
</ItemGroup>
6973

7074
<!--PLAYGROUND-->

OnixLabs.Core.UnitTests/ResultExtensionTests.cs

Lines changed: 183 additions & 172 deletions
Large diffs are not rendered by default.

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticAbsDataAttribute.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System.Collections.Generic;
16-
using System.Reflection;
17-
using Xunit.Sdk;
18-
1915
namespace OnixLabs.Numerics.UnitTests.Data;
2016

21-
public sealed class BigDecimalArithmeticAbsDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticAbsDataAttribute : TestDataAttribute
2218
{
2319
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2420
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticAdditionDataAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
17-
using System.Reflection;
18-
using Xunit.Sdk;
19-
2015
namespace OnixLabs.Numerics.UnitTests.Data;
2116

22-
public sealed class BigDecimalArithmeticAdditionDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticAdditionDataAttribute : TestDataAttribute
2318
{
2419
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2520
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticDivisionDataAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
17-
using System.Reflection;
18-
using Xunit.Sdk;
19-
2015
namespace OnixLabs.Numerics.UnitTests.Data;
2116

22-
public sealed class BigDecimalArithmeticDivisionDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticDivisionDataAttribute : TestDataAttribute
2318
{
2419
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2520
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticModulusDataAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
17-
using System.Reflection;
18-
using Xunit.Sdk;
19-
2015
namespace OnixLabs.Numerics.UnitTests.Data;
2116

22-
public sealed class BigDecimalArithmeticModulusDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticModulusDataAttribute : TestDataAttribute
2318
{
2419
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2520
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticMultiplicationDataAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
17-
using System.Reflection;
18-
using Xunit.Sdk;
19-
2015
namespace OnixLabs.Numerics.UnitTests.Data;
2116

22-
public sealed class BigDecimalArithmeticMultiplicationDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticMultiplicationDataAttribute : TestDataAttribute
2318
{
2419
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2520
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticPowDataAttribute.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System.Collections.Generic;
16-
using System.Reflection;
17-
using Xunit.Sdk;
18-
1915
namespace OnixLabs.Numerics.UnitTests.Data;
2016

21-
public sealed class BigDecimalArithmeticPowDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticPowDataAttribute : TestDataAttribute
2218
{
2319
private static readonly (decimal Value, int Exponent, decimal Expected)[] Data =
2420
[

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticRoundDataAttribute.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
1715
using System.Linq;
18-
using System.Reflection;
19-
using Xunit.Sdk;
2016

2117
namespace OnixLabs.Numerics.UnitTests.Data;
2218

23-
public sealed class BigDecimalArithmeticRoundDataAttribute : DataAttribute
19+
public sealed class BigDecimalArithmeticRoundDataAttribute : TestDataAttribute
2420
{
2521
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
2622
{

OnixLabs.Numerics.UnitTests.Data/BigDecimalArithmeticScaleDataAttribute.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
16-
using System.Collections.Generic;
17-
using System.Reflection;
18-
using Xunit.Sdk;
19-
2015
namespace OnixLabs.Numerics.UnitTests.Data;
2116

22-
public sealed class BigDecimalArithmeticScaleDataAttribute : DataAttribute
17+
public sealed class BigDecimalArithmeticScaleDataAttribute : TestDataAttribute
2318
{
2419
private static readonly int[] Integers = [0, 1, 2, 3, 123, 123456789, -1, -2, -3, -123, -123456789];
2520

0 commit comments

Comments
 (0)