Skip to content

Migrate test framework from xUnit to TUnit#4

Merged
mg0x7BE merged 1 commit intomasterfrom
copilot/verify-xunit-to-tunit
Apr 22, 2026
Merged

Migrate test framework from xUnit to TUnit#4
mg0x7BE merged 1 commit intomasterfrom
copilot/verify-xunit-to-tunit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Replace xUnit with TUnit as the sole test framework, as the existing tests use only basic xUnit primitives with direct TUnit equivalents.

Changes

  • DayPhaseIndicator.Tests.csproj — Swap 3 xUnit packages (xunit, xunit.runner.visualstudio, Microsoft.NET.Test.Sdk) for single TUnit 1.37.24. Add OutputType: Exe + TestingPlatformDotnetTestSupport (required by TUnit's source-gen runner model).
  • global.json (new) — Opt in to Microsoft.Testing.Platform runner, required for dotnet test on .NET 10 SDK (VSTest no longer supported).
  • PhaseLogicTests.cs — Rewrite using TUnit API:
// Before (xUnit)
[Theory]
[InlineData(10, 0, "WORK")]
public void FindCurrentPhase_StandardSchedule(int hour, int minute, string expectedLabel)
{
    Assert.Equal(expectedLabel, phase.Label);
}

// After (TUnit)
[Test]
[Arguments(10, 0, "WORK")]
public async Task FindCurrentPhase_StandardSchedule(int hour, int minute, string expectedLabel)
{
    await Assert.That(phase.Label).IsEqualTo(expectedLabel);
}

All 15 tests pass on both dotnet test (solution-level) and direct executable invocation.

Agent-Logs-Url: https://github.com/mg0x7BE/day-phase-indicator/sessions/7840e9fa-16bb-4f93-b12d-3fc621c3de1c

Co-authored-by: mg0x7BE <108034506+mg0x7BE@users.noreply.github.com>
@mg0x7BE mg0x7BE marked this pull request as ready for review April 22, 2026 10:32
@mg0x7BE mg0x7BE merged commit acd9845 into master Apr 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants