Skip to content

Release v4.2.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 03:24
95bf5dc

Summary

Specifications now ships packages for TUnit, xUnit v3 and NUnit 5 next to the existing xUnit and NUnit packages. All packages share one faster lifecycle implementation, and the existing packages stay compatible with 4.x. See the README for which package to pick.

Added

  • Cratis.Specifications.TUnit for writing Establish/Because/should_ specifications on TUnit and Microsoft.Testing.Platform (#60)
  • Cratis.Specifications.XUnit.v3 for writing specifications on xUnit v3, including the shared specification lifecycle the xUnit package offers (#62)
  • Cratis.Specifications.NUnit5 for writing specifications on NUnit 5. Unlike the NUnit 4 package, its ShouldEqual compares sequences in order (#63)
  • Analyzer CRSPEC0008 reports should_ facts that modify the shared specification context. It is reported as info by default and can be raised through .editorconfig (part of #61)

Changed

  • Establish, Because and Destroy now run through a cached invoker shared by all packages, so specifications start faster (part of #61)
  • Should* assertion failure messages are only formatted when an assertion fails (part of #61)
  • The specification analyzers do less work per symbol, so builds with many specifications are faster (part of #61)

Fixed

  • Establish, Because and Destroy declared on a base specification no longer run twice (#61)
  • Exceptions thrown from Establish, Because and Destroy are reported as thrown, not wrapped in TargetInvocationException (part of #61)
  • Lifecycle methods returning ValueTask are now awaited (part of #61)
  • Building the repository works on any .NET 10 SDK feature band; global.json no longer pins an unavailable SDK version (#50)