Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: serilog-contrib/serilog-formatting-log4net
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: serilog-contrib/serilog-formatting-log4net
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: tunit-Constructor-and-Dispose
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on May 4, 2025

  1. Experiment with using TUnit instead of xUnit

    Remaining issues
    
    * TUnit provides a very basic [GitHub summary reporter][1] out of the box, but the more feature complete GitHubActionsTestLogger is currently [not supported for Microsoft.Testing.Platform][2]
    * HTML logger: could not find an equivalent for Microsoft.Testing.Platform
    * Stryker: currently [not supported for Microsoft.Testing.Platform][3]
    
    [1]: https://github.com/thomhurst/TUnit/blob/f857682f30e767df0f352fc2f5218c6fb5127ed3/TUnit.Engine/Reporters/GitHubReporter.cs
    [2]: Tyrrrz/GitHubActionsTestLogger#41
    [3]: stryker-mutator/stryker-net#3094
    0xced committed May 4, 2025
    Configuration menu
    Copy the full SHA
    bb7187f View commit details
    Browse the repository at this point in the history
  2. Use Constructor / Dispose instead of [Before(Test)] / [After(Test)]

    Note that this fails the two test with the [NotInParallel] attribute, i.e. FilterPropertyThrowing and ExceptionFormatterThrowing.
    
    The [Test Set Ups][1] and [Test Clean Ups][2] documentation mentions respectively:
    
    > Most setup for a test can be performed in the constructor (think setting up mocks, assigning fields.)
    
    and
    
    > TUnit supports having your test class implement `IDisposable` or `IAsyncDisposable`. These will be called after your test has finished executing.
    
    So I'm not sure what's the difference between Custructor/Dispose and [Before(Test)] / [After(Test)] attributes.
    
    [1]: https://thomhurst.github.io/TUnit/docs/tutorial-extras/setup
    [2]: https://thomhurst.github.io/TUnit/docs/tutorial-extras/cleanup
    0xced committed May 4, 2025
    Configuration menu
    Copy the full SHA
    8cfdbfc View commit details
    Browse the repository at this point in the history
Loading