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
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.ExpandClassTimelinehas 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.Mockspackages are now stable (previously experimental). The mocking API supports:Arg.AnyArgs()shortcut for setup/verifyIf any tests would benefit from mocking (e.g. mocking
HttpClientdependencies),TUnit.Mocksis now a stable option within the TUnit ecosystem.See: thomhurst/TUnit#5877
Performance improvements (1.43.x)
These apply automatically with the upgrade — no code changes needed.
Action
Report.ExpandClassTimelineand migrate to[ClassTimeline]TUnit.Mocks