Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to TUnit for unit testing #714

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<Nullable>enable</Nullable>
<WarningsAsErrors>$(WarningsAsErrors);nullable;</WarningsAsErrors>
<Features>strict</Features>

<ImplicitUsings>enable</ImplicitUsings>

Expand Down
17 changes: 5 additions & 12 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.3" />
<PackageVersion Include="DocFx.App" Version="2.78.2" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
Expand All @@ -23,17 +23,10 @@
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="ThisAssembly.Resources" Version="1.4.3" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="TUnit.Engine" Version="0.6.15" />
<PackageVersion Include="xunit.v3.assert" Version="1.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.1' ">
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" />
</ItemGroup>


<ItemGroup>
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.184" />
<GlobalPackageReference Include="PolySharp" Version="1.15.0" />
Expand Down
4 changes: 0 additions & 4 deletions Source/SuperLinq.Async/SuperLinq.Async.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<PropertyGroup>
<AssemblyName>SuperLinq.Async</AssemblyName>
<RootNamespace>SuperLinq.Async</RootNamespace>
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>

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

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/viceroypenguin/SuperLinq</RepositoryUrl>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
Expand Down
6 changes: 1 addition & 5 deletions Source/SuperLinq/SuperLinq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<PropertyGroup>
<AssemblyName>SuperLinq</AssemblyName>
<RootNamespace>SuperLinq</RootNamespace>
<TargetFrameworks>netstandard2.0;$(TargetFrameworks)</TargetFrameworks>

<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>

Expand All @@ -23,9 +22,6 @@

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/viceroypenguin/SuperLinq</RepositoryUrl>

<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -167,7 +163,7 @@
<PackageReference Include="Microsoft.Bcl.HashCode" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
<PackageReference Include="MinVer" PrivateAssets="All" />
<PackageReference Include="System.Memory" />
<PackageReference Include="System.Memory" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
Expand Down
4 changes: 2 additions & 2 deletions SuperLinq.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{99F4CCA1
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq", "Source\SuperLinq\SuperLinq.csproj", "{921016AA-80B6-44ED-8A92-E96601C92C4E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Test", "Tests\SuperLinq.Test\SuperLinq.Test.csproj", "{674D18D8-CCE1-4102-AF6E-E6F993813422}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Test", "Tests\SuperLinq.Tests\SuperLinq.Tests.csproj", "{674D18D8-CCE1-4102-AF6E-E6F993813422}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async", "Source\SuperLinq.Async\SuperLinq.Async.csproj", "{84058331-3025-438D-8A68-B55EE859C70D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async.Test", "Tests\SuperLinq.Async.Test\SuperLinq.Async.Test.csproj", "{1A4F94C6-2143-486B-B787-271506C327FC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperLinq.Async.Test", "Tests\SuperLinq.Async.Tests\SuperLinq.Async.Tests.csproj", "{1A4F94C6-2143-486B-B787-271506C327FC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generators", "Generators", "{7805222E-6CD5-41FE-9945-0D9FD7DFA24C}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion TargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '8.0'))">$(TargetFrameworks);net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '9.0'))">$(TargetFrameworks);net9.0</TargetFrameworks>
</PropertyGroup>
Expand Down
47 changes: 0 additions & 47 deletions Tests/SuperLinq.Async.Test/CountDownTest.cs

This file was deleted.

60 changes: 0 additions & 60 deletions Tests/SuperLinq.Async.Test/DuplicatesTest.cs

This file was deleted.

63 changes: 0 additions & 63 deletions Tests/SuperLinq.Async.Test/HasDuplicatesTest.cs

This file was deleted.

50 changes: 0 additions & 50 deletions Tests/SuperLinq.Async.Test/SuperLinq.Async.Test.csproj

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[*.cs]

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

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

# xUnit errors
dotnet_diagnostic.xUnit1008.severity = error # xUnit1008: Test data attribute should only be used on a Theory
dotnet_diagnostic.xUnit1013.severity = error # xUnit1013: Public method should be marked as test
dotnet_diagnostic.xUnit1042.severity = none # xUnit1042: The member referenced by the MemberData attribute returns untyped data rows

dotnet_diagnostic.MA0046.severity = none
dotnet_diagnostic.TUnit0046.severity = none
Loading
Loading