Skip to content

Adopt TUnit 1.44 features: [ClassTimeline] attribute and stable TUnit.Mocks #449

@sliekens

Description

@sliekens

The recent upgrade of TUnit from 1.41.0 to 1.44.0 introduced several new features worth considering for the test suite.

New features

[ClassTimeline] attribute (1.43.x → 1.44.0)

Report.ExpandClassTimeline has been replaced by a [ClassTimeline] attribute that can be applied at the class level. If any test class currently uses the report-based approach, it should be migrated to the new attribute.

See: thomhurst/TUnit#5875

TUnit.Mocks promoted to stable (1.44.0)

TUnit.Mocks packages are now stable (previously experimental). The mocking API supports:

  • Generated mocks in the same namespace as the mocked type
  • Arg.AnyArgs() shortcut for setup/verify
  • Non-span ref struct out/ref params
  • Structural fixes for Mock / mocked-member name collisions

If any tests would benefit from mocking (e.g. mocking HttpClient dependencies), TUnit.Mocks is now a stable option within the TUnit ecosystem.

See: thomhurst/TUnit#5877

Performance improvements (1.43.x)

  • Skip execution ledger for independent tests
  • Skip tracked object graph rediscovery

These apply automatically with the upgrade — no code changes needed.

Action

  • Check if any test class uses Report.ExpandClassTimeline and migrate to [ClassTimeline]
  • Evaluate whether any test could benefit from TUnit.Mocks

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency fileenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions