Skip to content
Closed
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: 4 additions & 0 deletions Lombiq.MSBuild.OrchardCore.Tests.Sdk/Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Lombiq MSBuild SDK - Unit Testing

This MSBuild SDK can be used for unit testing with the [Lombiq.Tests](https://github.com/Lombiq/Testing-Toolbox) library. See [Using MSBuild SDKs](../Docs/UsingMSBuildSdks.md) for information on how to use it.

The SDK configures xUnit 4 and Microsoft Testing Platform (MTP), including the `Microsoft.Testing.Extensions.GitHubActionsReport`, `Microsoft.Testing.Extensions.TrxReport`, and `Microsoft.Testing.Extensions.HangDump` packages. Projects using central package management must declare versions for these packages and `xunit.v3` in _Directory.Packages.props_.

Use .NET SDK 10 or later, and add `"test": { "runner": "Microsoft.Testing.Platform" }` to the solution's _global.json_. Preserve any existing SDK settings. Run tests with `dotnet test --project path/to/Tests.csproj` or `dotnet test --solution path/to/Solution.slnx`.
18 changes: 10 additions & 8 deletions Lombiq.MSBuild.OrchardCore.Tests.Sdk/Sdk/Core.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
<PropertyGroup>
<LombiqSdkName>OrchardCore.Tests</LombiqSdkName>
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">18.9.0</Version>
<PackageReference Include="Microsoft.Testing.Extensions.GitHubActionsReport">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">2.4.0</Version>
</PackageReference>
<PackageReference Include="xunit.v3">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">3.2.2</Version>
<PackageReference Include="Microsoft.Testing.Extensions.HangDump">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">2.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">2.4.0</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">3.1.5</Version>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="xunit.v3">
<Version Condition="'$(ManagePackageVersionsCentrally)' != 'true'">4.0.0</Version>
</PackageReference>
</ItemGroup>

Expand Down
11 changes: 5 additions & 6 deletions Lombiq.MSBuild.Targets.Tests/Lombiq.MSBuild.Targets.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.GitHubActionsReport" Version="2.4.0" />
<PackageReference Include="Microsoft.Testing.Extensions.HangDump" Version="2.4.0" />
<PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="2.4.0" />
<PackageReference Include="xunit.v3" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Loading