Skip to content

Commit 42e4c5d

Browse files
Migrate to TUnit for unit testing (#714)
1 parent 20cee43 commit 42e4c5d

File tree

282 files changed

+4211
-4164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+4211
-4164
lines changed

Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
<Nullable>enable</Nullable>
66
<WarningsAsErrors>$(WarningsAsErrors);nullable;</WarningsAsErrors>
7+
<Features>strict</Features>
78

89
<ImplicitUsings>enable</ImplicitUsings>
910

Directory.Packages.props

+5-12
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
9-
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
8+
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
9+
<PackageVersion Include="coverlet.msbuild" Version="6.0.3" />
1010
<PackageVersion Include="DocFx.App" Version="2.78.2" />
1111
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
1212
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
@@ -23,17 +23,10 @@
2323
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
2424
<PackageVersion Include="System.Memory" Version="4.5.5" />
2525
<PackageVersion Include="ThisAssembly.Resources" Version="1.4.3" />
26-
<PackageVersion Include="xunit" Version="2.9.2" />
26+
<PackageVersion Include="TUnit.Engine" Version="0.6.15" />
27+
<PackageVersion Include="xunit.v3.assert" Version="1.0.0" />
2728
</ItemGroup>
28-
29-
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' ">
30-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" />
31-
</ItemGroup>
32-
33-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
34-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" />
35-
</ItemGroup>
36-
29+
3730
<ItemGroup>
3831
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.184" />
3932
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />

Source/SuperLinq.Async/SuperLinq.Async.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<PropertyGroup>
66
<AssemblyName>SuperLinq.Async</AssemblyName>
77
<RootNamespace>SuperLinq.Async</RootNamespace>
8-
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>
98

109
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
1110
</PropertyGroup>
@@ -21,9 +20,6 @@
2120

2221
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2322
<RepositoryUrl>https://github.com/viceroypenguin/SuperLinq</RepositoryUrl>
24-
25-
<IncludeSymbols>true</IncludeSymbols>
26-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2723
</PropertyGroup>
2824

2925
<PropertyGroup>

Source/SuperLinq/SuperLinq.csproj

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<PropertyGroup>
66
<AssemblyName>SuperLinq</AssemblyName>
77
<RootNamespace>SuperLinq</RootNamespace>
8-
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>
98

109
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
1110

@@ -23,9 +22,6 @@
2322

2423
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2524
<RepositoryUrl>https://github.com/viceroypenguin/SuperLinq</RepositoryUrl>
26-
27-
<IncludeSymbols>true</IncludeSymbols>
28-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2925
</PropertyGroup>
3026

3127
<PropertyGroup>
@@ -167,7 +163,7 @@
167163
<PackageReference Include="Microsoft.Bcl.HashCode" />
168164
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
169165
<PackageReference Include="MinVer" PrivateAssets="All" />
170-
<PackageReference Include="System.Memory" />
166+
<PackageReference Include="System.Memory" />
171167
</ItemGroup>
172168

173169
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">

SuperLinq.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{99F4CCA1
2020
EndProject
2121
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq", "Source\SuperLinq\SuperLinq.csproj", "{921016AA-80B6-44ED-8A92-E96601C92C4E}"
2222
EndProject
23-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Test", "Tests\SuperLinq.Test\SuperLinq.Test.csproj", "{674D18D8-CCE1-4102-AF6E-E6F993813422}"
23+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Test", "Tests\SuperLinq.Tests\SuperLinq.Tests.csproj", "{674D18D8-CCE1-4102-AF6E-E6F993813422}"
2424
EndProject
2525
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async", "Source\SuperLinq.Async\SuperLinq.Async.csproj", "{84058331-3025-438D-8A68-B55EE859C70D}"
2626
EndProject
27-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async.Test", "Tests\SuperLinq.Async.Test\SuperLinq.Async.Test.csproj", "{1A4F94C6-2143-486B-B787-271506C327FC}"
27+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async.Test", "Tests\SuperLinq.Async.Tests\SuperLinq.Async.Tests.csproj", "{1A4F94C6-2143-486B-B787-271506C327FC}"
2828
EndProject
2929
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generators", "Generators", "{7805222E-6CD5-41FE-9945-0D9FD7DFA24C}"
3030
EndProject

TargetFrameworks.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
55
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '8.0'))">$(TargetFrameworks);net8.0</TargetFrameworks>
66
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '9.0'))">$(TargetFrameworks);net9.0</TargetFrameworks>
77
</PropertyGroup>

Tests/SuperLinq.Async.Test/CountDownTest.cs

-47
This file was deleted.

Tests/SuperLinq.Async.Test/DuplicatesTest.cs

-60
This file was deleted.

Tests/SuperLinq.Async.Test/HasDuplicatesTest.cs

-63
This file was deleted.

Tests/SuperLinq.Async.Test/SuperLinq.Async.Test.csproj

-50
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[*.cs]
22

33
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
4+
dotnet_diagnostic.CA1822.severity = none # CA1822: Mark members as static
45
dotnet_diagnostic.CA1861.severity = none # CA1861: Avoid constant arrays as arguments
56
dotnet_diagnostic.CA2201.severity = none # CA2201: Do not raise reserved exception types
67

@@ -11,9 +12,5 @@ dotnet_diagnostic.CS1573.severity = none # CS1573: Missing XML co
1112
dotnet_diagnostic.CS1591.severity = none # CS1591: Missing XML comment for publicly visible type or member
1213
dotnet_diagnostic.CS1712.severity = none # CS1712: Type parameter has no matching typeparam tag in the XML comment (but other type parameters do)
1314

14-
# xUnit errors
15-
dotnet_diagnostic.xUnit1008.severity = error # xUnit1008: Test data attribute should only be used on a Theory
16-
dotnet_diagnostic.xUnit1013.severity = error # xUnit1013: Public method should be marked as test
17-
dotnet_diagnostic.xUnit1042.severity = none # xUnit1042: The member referenced by the MemberData attribute returns untyped data rows
18-
1915
dotnet_diagnostic.MA0046.severity = none
16+
dotnet_diagnostic.TUnit0046.severity = none

0 commit comments

Comments
 (0)