Skip to content

CODESTYLE conformance: migrate tests to xUnit v3 + AwesomeAssertions, and expose logging via ILoggerFactory #380

Description

@ptr727

Two CODESTYLE conformance gaps found in the fleet audit (rules added in ptr727/ProjectTemplate#270).

1. Tests: xUnit v3 + AwesomeAssertions (CODESTYLE §Testing Conventions)

Current: Directory.Packages.props pins xunit 2.9.3 (legacy v2), and UtilitiesTests/*.cs use using Xunit + native asserts (Assert.Equal, Assert.True, ...).
Target:

  • Replace the v2 xunit package with xunit.v3 (3.2.2, matching the fleet).
  • Add AwesomeAssertions and convert every Assert.* to the fluent .Should() API.
  • Reference peers already on this: LanguageTags, PlexCleaner, PhotoCleaner, MediaTools, NxWitness.

2. Library logging via ILoggerFactory, drop Serilog (CODESTYLE §Error Handling and Logging)

Current: Utilities/Utilities.csproj references Serilog directly, forcing a logging framework on every consumer (and it is not AOT-annotated).
Target:

  • The library depends only on Microsoft.Extensions.Logging.Abstractions and exposes an ILoggerFactory seam (settable factory defaulting to NullLoggerFactory, SetFactory/TrySetFactory).
  • Any consuming app owns the concrete Serilog logger and injects it via SerilogLoggerFactory.
  • Reference implementation: LanguageTagsLanguageTags/LogOptions.cs (library seam) + LanguageTagsCreate/LoggerFactory.cs (app-side Serilog bridge).
  • Note: this changes the library's public logging surface (semver-major).

Audited from develop, 2026-07-09.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions