Skip to content

Commit

Permalink
feat: Added support for XUnit.V3 (#500)
Browse files Browse the repository at this point in the history
* feat: Added support for `XUnit.V3`

* chore: Simplified collections

* chore: Removed unnecessary file

* chore: Added additional PublicApi tests for XUnit.V3

* fix: Resolved several SonarQube warnings

* fix: Repaired tests

* fix: Disabled Execute_English for `Xunit.V3`
  • Loading branch information
samtrion authored Oct 30, 2024
1 parent 73176ba commit 8051002
Show file tree
Hide file tree
Showing 114 changed files with 2,640 additions and 106 deletions.
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>

<ItemGroup>
<GlobalPackageReference Include="CSharpier.MSBuild" Version="0.29.2" />
<GlobalPackageReference Include="GitVersion.MsBuild" Version="6.0.3" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" Condition=" '$(BuildingInsideVisualStudio)' == 'true' " />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
Expand All @@ -28,9 +26,11 @@
<PackageVersion Include="Verify.MSTest" Version="28.0.0" />
<PackageVersion Include="Verify.NUnit" Version="28.0.0" />
<PackageVersion Include="Verify.Xunit" Version="28.0.0" />
<PackageVersion Include="Verify.XunitV3" Version="28.0.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.extensibility.core" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.v3" Version="0.5.0-pre.27" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="0.5.0-pre.27" />
</ItemGroup>

</Project>
25 changes: 23 additions & 2 deletions Extensions.Test.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.MSTest
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.XUnit.Tests.PublicApi", "tests\NetEvolve.Extensions.XUnit.Tests.PublicApi\NetEvolve.Extensions.XUnit.Tests.PublicApi.csproj", "{4D92E42D-68F1-4092-BDB7-29F6265C8CEC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.NUnit.Tests.PublicApi", "tests\NetEvolve.Extensions.NUnit.Tests.PublicApi\NetEvolve.Extensions.NUnit.Tests.PublicApi.csproj", "{4F4B90A9-9371-4D13-875B-331468D1E888}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.NUnit.Tests.PublicApi", "tests\NetEvolve.Extensions.NUnit.Tests.PublicApi\NetEvolve.Extensions.NUnit.Tests.PublicApi.csproj", "{4F4B90A9-9371-4D13-875B-331468D1E888}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetEvolve.Extensions.MSTest.Tests.PublicApi", "tests\NetEvolve.Extensions.MSTest.Tests.PublicApi\NetEvolve.Extensions.MSTest.Tests.PublicApi.csproj", "{37815304-2B2A-4EE1-A1A2-A947794ED7A5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.MSTest.Tests.PublicApi", "tests\NetEvolve.Extensions.MSTest.Tests.PublicApi\NetEvolve.Extensions.MSTest.Tests.PublicApi.csproj", "{37815304-2B2A-4EE1-A1A2-A947794ED7A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.XUnit.V3", "src\NetEvolve.Extensions.XUnit.V3\NetEvolve.Extensions.XUnit.V3.csproj", "{E59DDFAC-7E76-41B8-B347-344E2AB5046C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetEvolve.Extensions.XUnit.V3.Tests.Unit", "tests\NetEvolve.Extensions.XUnit.V3.Tests.Unit\NetEvolve.Extensions.XUnit.V3.Tests.Unit.csproj", "{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17}"
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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -86,6 +92,18 @@ Global
{37815304-2B2A-4EE1-A1A2-A947794ED7A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37815304-2B2A-4EE1-A1A2-A947794ED7A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37815304-2B2A-4EE1-A1A2-A947794ED7A5}.Release|Any CPU.Build.0 = Release|Any CPU
{E59DDFAC-7E76-41B8-B347-344E2AB5046C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E59DDFAC-7E76-41B8-B347-344E2AB5046C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E59DDFAC-7E76-41B8-B347-344E2AB5046C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E59DDFAC-7E76-41B8-B347-344E2AB5046C}.Release|Any CPU.Build.0 = Release|Any CPU
{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CB5E4DA-E255-40A2-97FA-834CE0CA7F17}.Release|Any CPU.Build.0 = Release|Any CPU
{852AA7AA-0F8B-4A13-8C56-D86753B3C054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -100,6 +118,9 @@ Global
{4D92E42D-68F1-4092-BDB7-29F6265C8CEC} = {D67E420A-2329-4879-B82C-069039603B81}
{4F4B90A9-9371-4D13-875B-331468D1E888} = {D67E420A-2329-4879-B82C-069039603B81}
{37815304-2B2A-4EE1-A1A2-A947794ED7A5} = {D67E420A-2329-4879-B82C-069039603B81}
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EBB4607C-57F7-4F91-93B2-A444A3D33755}
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# NetEvolve.Extensions

Compatibility library for solutions using multiple .NET test frameworks.
The following test frameworks are supported -
[NetEvolve.Extensions.MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
[NetEvolve.Extensions.NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit) &
[NetEvolve.Extensions.XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit).
The following test frameworks are supported
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit)
- [XUnit.V3](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit.V3)
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/AcceptanceTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.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 : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/ArchitectureTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.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 : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/CodedUITestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.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 : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/EndToEndTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.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 : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/FunctionalTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.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 : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/IntegrationTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>IntegrationTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class IntegrationTestAttribute : TestTraitBaseAttribute
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@
"IDE1006:Naming Styles",
Justification = "As designed."
)]
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true,
Inherited = true
)]
public abstract class TestTraitBaseAttribute : TestCategoryBaseAttribute
{
/// <inheritdoc/>
public override IList<string> TestCategories { get; }

/// <inheritdoc/>
protected TestTraitBaseAttribute(string categoryName)
: base() => TestCategories = new List<string> { categoryName };
: base() => TestCategories = [categoryName];
}
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/PerformanceTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>PerformanceTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class PerformanceTestAttribute : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/PostDeploymentAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>PostDeployment</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class PostDeploymentAttribute : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/PreDeploymentAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>PreDeployment</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class PreDeploymentAttribute : TestTraitBaseAttribute
{
/// <summary>
Expand Down
9 changes: 5 additions & 4 deletions src/NetEvolve.Extensions.MSTest/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# NetEvolve.Extensions.MSTest

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) &
[XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit).
The following test frameworks are supported
- [MSTest](https://www.nuget.org/packages/NetEvolve.Extensions.MSTest),
- [NUnit](https://www.nuget.org/packages/NetEvolve.Extensions.NUnit)
- [XUnit](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit)
- [XUnit.V3](https://www.nuget.org/packages/NetEvolve.Extensions.XUnit.V3)

## Basic functionality

Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.MSTest/UnitTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.MSTest;

using System;
using NetEvolve.Extensions.MSTest.Internal;

/// <summary>
/// Attribute used to decorate a test class or method as <b>UnitTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class UnitTestAttribute : TestTraitBaseAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/AcceptanceTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <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 : CategoryAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/ArchitectureTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <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 : CategoryAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/CodedUITestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <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 : CategoryAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/EndToEndTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <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 : CategoryAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/FunctionalTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <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 : CategoryAttribute
{
/// <summary>
Expand Down
5 changes: 5 additions & 0 deletions src/NetEvolve.Extensions.NUnit/PerformanceTestAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace NetEvolve.Extensions.NUnit;

using System;
using global::NUnit.Framework;

/// <summary>
/// Attribute used to decorate a test class or method as <b>PerformanceTest</b>.
/// </summary>
[AttributeUsage(
AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method,
AllowMultiple = true
)]
public sealed class PerformanceTestAttribute : CategoryAttribute
{
/// <summary>
Expand Down
Loading

0 comments on commit 8051002

Please sign in to comment.