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

## Coverage
  * `dotnet run --coverage` doesn't run the VSTest target so ReportGenerator can't be hooked
  * `dotnet test --coverage` fails with MSB1001: Unknown switch
##  Stryker
  * Currently not supported for Microsoft.Testing.Platform, see stryker-mutator/stryker-net#3094
  • Loading branch information
0xced committed Dec 20, 2024
1 parent a437307 commit ad04437
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 107 deletions.
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 ad04437

Please sign in to comment.