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

feat: Support for TUnit #549

Merged
merged 7 commits into from
Dec 12, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ on:
jobs:
all:
name: Build & Tests
uses: dailydevops/pipelines/.github/workflows/[email protected].43
uses: dailydevops/pipelines/.github/workflows/[email protected].44
with:
dotnet-logging: ${{ inputs.dotnet-logging }}
dotnet-version: 7.x
dotnet-version: ${{ vars.NE_DOTNET_TARGETFRAMEWORKS }}
enableSonarQube: true
solution: ./Extensions.Test.sln
secrets: inherit
Empty file removed .gitmodules
Empty file.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Title>$(PackageId)</Title>
<Description>This library provides various compatibility features between `NUnit`, `XUnit` and `MSTest`.</Description>
<Description>This library provides various compatibility features between `NUnit`, `XUnit`, `TUnit` and `MSTest`.</Description>

<CopyrightYearStart>2023</CopyrightYearStart>

Expand All @@ -22,7 +22,7 @@

<PropertyGroup>
<NetEvolve_ProjectTargetFrameworks>netstandard2.0;net8.0;net9.0</NetEvolve_ProjectTargetFrameworks>
<NetEvolve_TestTargetFrameworks>net6.0;net8.0;</NetEvolve_TestTargetFrameworks>
<NetEvolve_TestTargetFrameworks>net6.0;net8.0;net9.0</NetEvolve_TestTargetFrameworks>

<NoWarn Condition=" '$(TargetFramework)' == 'netstandard2.0' ">$(NoWarn);CA1062;</NoWarn>

Expand Down
3 changes: 0 additions & 3 deletions Directory.Build.targets

This file was deleted.

12 changes: 8 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.12.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageVersion Include="MSTest.TestFramework" Version="3.6.4" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
<PackageVersion Include="TUnit" Version="0.4.99" />
<PackageVersion Include="TUnit.Core" Version="0.4.99" />
<PackageVersion Include="Verify.MSTest" Version="28.4.0" />
<PackageVersion Include="Verify.NUnit" Version="28.4.0" />
<PackageVersion Include="Verify.TUnit" Version="28.4.0" />
<PackageVersion Include="Verify.Xunit" Version="28.4.0" />
<PackageVersion Include="Verify.XunitV3" Version="28.1.3" />
<PackageVersion Include="Verify.XunitV3" Version="28.4.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.extensibility.core" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.49" />
<PackageVersion Include="xunit.v3" Version="0.5.0-pre.27" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="0.5.0-pre.27" />
<PackageVersion Include="xunit.v3" Version="0.7.0-pre.15" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="0.7.0-pre.15" />
</ItemGroup>
</Project>
</Project>
23 changes: 21 additions & 2 deletions Extensions.Test.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.filenesting.json = .filenesting.json
.gitignore = .gitignore
.gitmodules = .gitmodules
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
Directory.Solution.props = Directory.Solution.props
GitVersion.yml = GitVersion.yml
Expand Down Expand Up @@ -50,6 +48,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.XUnit.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.XUnit.V3.Tests.PublicApi", "tests\NetEvolve.Extensions.XUnit.V3.Tests.PublicApi\NetEvolve.Extensions.XUnit.V3.Tests.PublicApi.csproj", "{852AA7AA-0F8B-4A13-8C56-D86753B3C054}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.TUnit", "src\NetEvolve.Extensions.TUnit\NetEvolve.Extensions.TUnit.csproj", "{12320F24-3F55-4BCF-A773-6FCAB46EA6A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.TUnit.Tests.Unit", "tests\NetEvolve.Extensions.TUnit.Tests.Unit\NetEvolve.Extensions.TUnit.Tests.Unit.csproj", "{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.TUnit.Tests.PublicApi", "tests\NetEvolve.Extensions.TUnit.Tests.PublicApi\NetEvolve.Extensions.TUnit.Tests.PublicApi.csproj", "{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -104,6 +108,18 @@ Global
{852AA7AA-0F8B-4A13-8C56-D86753B3C054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{852AA7AA-0F8B-4A13-8C56-D86753B3C054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{852AA7AA-0F8B-4A13-8C56-D86753B3C054}.Release|Any CPU.Build.0 = Release|Any CPU
{12320F24-3F55-4BCF-A773-6FCAB46EA6A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{12320F24-3F55-4BCF-A773-6FCAB46EA6A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{12320F24-3F55-4BCF-A773-6FCAB46EA6A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{12320F24-3F55-4BCF-A773-6FCAB46EA6A6}.Release|Any CPU.Build.0 = Release|Any CPU
{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5}.Release|Any CPU.Build.0 = Release|Any CPU
{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -121,6 +137,9 @@ Global
{E59DDFAC-7E76-41B8-B347-344E2AB5046C} = {19B4116B-14B4-436F-8A52-E71DB9CFCA7C}
{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17} = {D67E420A-2329-4879-B82C-069039603B81}
{852AA7AA-0F8B-4A13-8C56-D86753B3C054} = {D67E420A-2329-4879-B82C-069039603B81}
{12320F24-3F55-4BCF-A773-6FCAB46EA6A6} = {19B4116B-14B4-436F-8A52-E71DB9CFCA7C}
{1E5B501F-C9D5-4C75-AF7A-EFC7D77EEAF5} = {D67E420A-2329-4879-B82C-069039603B81}
{D6A20E67-D073-4EBF-A5B7-AD08EF401AC8} = {D67E420A-2329-4879-B82C-069039603B81}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EBB4607C-57F7-4F91-93B2-A444A3D33755}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Compatibility library for solutions using multiple .NET test frameworks.
The following test frameworks are supported
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest)
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [TUnit](https://www.nuget.org/packages/NetEvolve.Extensions.TUnit)
- [XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit)
- [XUnit.V3](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit.V3)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTags>$(PackageTags);mstest</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/NetEvolve.Extensions.MSTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Compatibility library for solutions using multiple .NET test frameworks.
The following test frameworks are supported
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest)
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [TUnit](https://www.nuget.org/packages/NetEvolve.Extensions.TUnit)
- [XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit)
- [XUnit.V3](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit.V3)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<PackageTags>$(PackageTags);nunit</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/NetEvolve.Extensions.NUnit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Compatibility library for solutions using multiple .NET test frameworks.
The following test frameworks are supported
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest)
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [TUnit](https://www.nuget.org/packages/NetEvolve.Extensions.TUnit)
- [XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit)
- [XUnit.V3](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit.V3)

Expand Down
20 changes: 20 additions & 0 deletions src/NetEvolve.Extensions.TUnit/AcceptanceTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>AcceptanceTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class AcceptanceTestAttribute : CategoryTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="AcceptanceTestAttribute"/> class.
/// </summary>
public AcceptanceTestAttribute()
: base(Internals.AcceptanceTest) { }
}
20 changes: 20 additions & 0 deletions src/NetEvolve.Extensions.TUnit/ArchitectureTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>ArchitectureTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class ArchitectureTestAttribute : CategoryTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="ArchitectureTestAttribute"/> class.
/// </summary>
public ArchitectureTestAttribute()
: base(Internals.ArchitectureTest) { }
}
30 changes: 30 additions & 0 deletions src/NetEvolve.Extensions.TUnit/BugAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace NetEvolve.Extensions.TUnit;

using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>Bug</b>, with optional Id.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public sealed class BugAttribute : CategoryWithIdTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="BugAttribute"/> class.
/// </summary>
public BugAttribute()
: base(Internals.Bug, null) { }

/// <summary>
/// Initializes a new instance of the <see cref="BugAttribute"/> class.
/// </summary>
/// <param name="id">Bug Id</param>
public BugAttribute(string? id)
: base(Internals.Bug, id) { }

/// <summary>
/// Initializes a new instance of the <see cref="BugAttribute"/> class.
/// </summary>
/// <param name="id">Bug Id</param>
public BugAttribute(long id)
: base(Internals.Bug, id) { }
}
20 changes: 20 additions & 0 deletions src/NetEvolve.Extensions.TUnit/CodedUITestAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>CodedUITest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class CodedUITestAttribute : CategoryTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="CodedUITestAttribute"/> class.
/// </summary>
public CodedUITestAttribute()
: base(Internals.CodedUITest) { }
}
20 changes: 20 additions & 0 deletions src/NetEvolve.Extensions.TUnit/EndToEndTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>EndToEndTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class EndToEndTestAttribute : CategoryTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="EndToEndTestAttribute"/> class.
/// </summary>
public EndToEndTestAttribute()
: base(Internals.EndToEndTest) { }
}
34 changes: 34 additions & 0 deletions src/NetEvolve.Extensions.TUnit/EpicAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>Epic</b>, with optional Id
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class EpicAttribute : CategoryWithIdTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="EpicAttribute"/> class.
/// </summary>
public EpicAttribute()
: base(Internals.Epic, null) { }

/// <summary>
/// Initializes a new instance of the <see cref="EpicAttribute"/> class.
/// </summary>
/// <param name="id">Bug Id</param>
public EpicAttribute(string? id)
: base(Internals.Epic, id) { }

/// <summary>
/// Initializes a new instance of the <see cref="EpicAttribute"/> class.
/// </summary>
/// <param name="id">Bug Id</param>
public EpicAttribute(long id)
: base(Internals.Epic, id) { }
}
34 changes: 34 additions & 0 deletions src/NetEvolve.Extensions.TUnit/FeatureAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>Feature</b>, with optional Id
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class FeatureAttribute : CategoryWithIdTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="FeatureAttribute"/> class.
/// </summary>
public FeatureAttribute()
: base(Internals.Feature, null) { }

/// <summary>
/// Initializes a new instance of the <see cref="FeatureAttribute"/> class.
/// </summary>
/// <param name="id">Feature Id</param>
public FeatureAttribute(string? id)
: base(Internals.Feature, id) { }

/// <summary>
/// Initializes a new instance of the <see cref="FeatureAttribute"/> class.
/// </summary>
/// <param name="id">Feature Id</param>
public FeatureAttribute(long id)
: base(Internals.Feature, id) { }
}
20 changes: 20 additions & 0 deletions src/NetEvolve.Extensions.TUnit/FunctionalTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NetEvolve.Extensions.TUnit;

using System;
using NetEvolve.Extensions.TUnit.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>FunctionalTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class FunctionalTestAttribute : CategoryTraitBaseAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="FunctionalTestAttribute"/> class.
/// </summary>
public FunctionalTestAttribute()
: base(Internals.FunctionalTest) { }
}
Loading
Loading