Skip to content

Commit

Permalink
Experiment with using TUnit instead of xUnit
Browse files Browse the repository at this point in the history
Remaining issues

* GitHub action: how to replace GitHubActionsTestLogger? See microsoft/testfx#4365
* HTML logger: could not find an equivalent for Microsoft.Testing.Platform
* Stryker: currently not supported for Microsoft.Testing.Platform, see stryker-mutator/stryker-net#3094
  • Loading branch information
0xced committed Dec 21, 2024
1 parent 9c83231 commit bff3587
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 138 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' && env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v4
with:
files: coverage/*/coverage.cobertura.xml
files: coverage/*/*.cobertura.xml
token: ${{ env.CODECOV_TOKEN }}
- name: ☂️ Upload coverage report to Codacy
env:
Expand All @@ -72,7 +72,7 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ env.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage/*/coverage.cobertura.xml
coverage-reports: coverage/*/*.cobertura.xml
- name: 📦 Create NuGet package
run: dotnet pack --no-build --output .
- name: 📤 Upload NuGet package artifact
Expand All @@ -84,7 +84,7 @@ jobs:
- name: 👽 Run mutation tests and upload report to Stryker dashboard
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
if: matrix.os == 'ubuntu-latest' && env.STRYKER_DASHBOARD_API_KEY != ''
if: matrix.os == 'DISABLED' && env.STRYKER_DASHBOARD_API_KEY != ''
run: |
dotnet tool restore
dotnet tool run dotnet-stryker --reporter dashboard --open-report:dashboard --version ${GITHUB_REF_NAME} --dashboard-api-key ${{ env.STRYKER_DASHBOARD_API_KEY }}
Expand Down
15 changes: 7 additions & 8 deletions tests/IndentationSettingsTest.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using System;
using FluentAssertions;
using Xunit;

namespace Serilog.Formatting.Log4Net.Tests;

public class IndentationSettingsTest
{
[Theory]
[InlineData(Indentation.Space, 2, " ")]
[InlineData(Indentation.Tab, 2, "\t\t")]
[InlineData(Indentation.Space, 4, " ")]
[InlineData(Indentation.Tab, 4, "\t\t\t\t")]
[Test]
[Arguments(Indentation.Space, (byte)2, " ")]
[Arguments(Indentation.Tab, (byte)2, "\t\t")]
[Arguments(Indentation.Space, (byte)4, " ")]
[Arguments(Indentation.Tab, (byte)4, "\t\t\t\t")]
public void IndentationSettingsToString(Indentation indentation, byte size, string expectedString)
{
// Arrange
Expand All @@ -23,7 +22,7 @@ public void IndentationSettingsToString(Indentation indentation, byte size, stri
indentationString.Should().Be(expectedString);
}

[Fact]
[Test]
public void InvalidIndentation()
{
// Act
Expand All @@ -34,7 +33,7 @@ public void InvalidIndentation()
.Which.Message.Should().StartWith("The value of argument 'indentation' (-1) is invalid for enum type 'Indentation'.");
}

[Fact]
[Test]
public void InvalidSize()
{
// Act
Expand Down
3 changes: 1 addition & 2 deletions tests/LineEndingTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using FluentAssertions;
using Xunit;

namespace Serilog.Formatting.Log4Net.Tests;

public class LineEndingTest
{
[Fact]
[Test]
public void InvalidLineEnding()
{
Action action = () => _ = new Log4NetTextFormatter(c => c.UseLineEnding((LineEnding)4));
Expand Down
Loading

0 comments on commit bff3587

Please sign in to comment.