Skip to content

Commit b2da539

Browse files
committed
TUnit conversion
1 parent ad2207c commit b2da539

6 files changed

Lines changed: 26 additions & 39 deletions

File tree

global.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"test": {
3+
"runner": "Microsoft.Testing.Platform"
4+
}
5+
}

src/Soenneker.Git.LibGit2Sharp/Soenneker.Git.LibGit2Sharp.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?><Project Sdk="Microsoft.NET.Sdk">
2-
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
43
<TargetFramework>net10.0</TargetFramework>
54
<Nullable>enable</Nullable>
@@ -32,11 +31,12 @@
3231
<LangVersion>latest</LangVersion>
3332
<PackageReadmeFile>README.md</PackageReadmeFile>
3433
<PackageIcon>icon.png</PackageIcon>
35-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
34+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3635
<PackageReleaseNotes Condition="'$(PACKAGE_RELEASE_NOTES)' != ''">
3736
$(PACKAGE_RELEASE_NOTES)
38-
</PackageReleaseNotes></PropertyGroup>
39-
37+
</PackageReleaseNotes>
38+
</PropertyGroup>
39+
4040
<ItemGroup>
4141
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
4242
<None Include="..\..\LICENSE" Pack="true" PackagePath="\" />

test/Soenneker.Git.LibGit2Sharp.Tests/Collection.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/Soenneker.Git.LibGit2Sharp.Tests/Fixture.cs renamed to test/Soenneker.Git.LibGit2Sharp.Tests/Host.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
using Microsoft.Extensions.Configuration;
1+
using System.Threading.Tasks;
2+
using Microsoft.Extensions.Configuration;
23
using Microsoft.Extensions.DependencyInjection;
34
using Serilog;
4-
using Soenneker.Fixtures.Unit;
5+
using Soenneker.TestHosts.Unit;
56
using Soenneker.Utils.Test;
67
using Soenneker.Git.LibGit2Sharp.Registrars;
78

89
namespace Soenneker.Git.LibGit2Sharp.Tests;
910

10-
public sealed class Fixture : UnitFixture
11+
public sealed class Host : UnitTestHost
1112
{
12-
public override System.Threading.Tasks.ValueTask InitializeAsync()
13+
public override Task InitializeAsync()
1314
{
1415
SetupIoC(Services);
1516

test/Soenneker.Git.LibGit2Sharp.Tests/LibGit2SharpUtilTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
using Soenneker.Git.LibGit2Sharp.Abstract;
2-
using Soenneker.Tests.FixturedUnit;
3-
using Xunit;
1+
using Soenneker.Git.LibGit2Sharp.Abstract;
2+
using Soenneker.Tests.HostedUnit;
43

54
namespace Soenneker.Git.LibGit2Sharp.Tests;
65

7-
[Collection("Collection")]
8-
public sealed class LibGit2SharpUtilTests : FixturedUnitTest
6+
[ClassDataSource<Host>(Shared = SharedType.PerTestSession)]
7+
public sealed class LibGit2SharpUtilTests : HostedUnitTest
98
{
109
private readonly ILibGit2SharpUtil _util;
1110

12-
public LibGit2SharpUtilTests(Fixture fixture, ITestOutputHelper output) : base(fixture, output)
11+
public LibGit2SharpUtilTests(Host host) : base(host)
1312
{
1413
_util = Resolve<ILibGit2SharpUtil>(true);
1514
}
1615

17-
[Fact]
16+
[Test]
1817
public void Default()
1918
{
2019

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<OutputType>Exe</OutputType>
54
<TargetFramework>net10.0</TargetFramework>
65
<Nullable>enable</Nullable>
76
<IsPackable>false</IsPackable>
8-
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
9-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
10-
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
11-
127
</PropertyGroup>
138

149
<ItemGroup>
@@ -21,9 +16,10 @@
2116
</Content>
2217
</ItemGroup>
2318

24-
<ItemGroup><PackageReference Include="Soenneker.Utils.Test" Version="4.0.314" />
25-
<PackageReference Include="Soenneker.Tests.FixturedUnit" Version="4.0.2303" />
26-
<PackageReference Include="xUnit.v3" Version="3.2.2" />
19+
<ItemGroup>
20+
<PackageReference Include="Soenneker.Utils.Test" Version="4.0.314" />
21+
<PackageReference Include="Soenneker.Tests.HostedUnit" Version="4.0.13" />
22+
<PackageReference Include="TUnit" Version="1.37.24" />
2723
</ItemGroup>
2824

2925
<ItemGroup>
@@ -32,8 +28,7 @@
3228

3329
<ItemGroup>
3430
<Content Include="testconfig.json">
35-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
31+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3632
</Content>
3733
</ItemGroup>
38-
3934
</Project>

0 commit comments

Comments
 (0)