Fluent Assertions 8.9 : meilleur support, meilleurs diagnostics, meilleure fluidité des tests

Fluent Assertions 8.9 est une version ciblée qui améliore trois aspects essentiels des tests .NET au quotidien : la prise en charge des types modernes, la lisibilité des assertions et le diagnostic des échecs. Pour les équipes qui écrivent et maintiennent de grandes suites de tests, ces mises à jour réduisent les frictions dans deux domaines qui affectent directement la vitesse d'exécution : l'écriture des assertions et le débogage des échecs.

What changed in 8.9

Broader support for modern .NET types

Fluent Assertions 8.9 adds extensive support for Span<T> et ReadOnlySpan<T>, along with Be(string) for Span<char> et ReadOnlySpan<char>.

This matters because these types show up more often in performance-sensitive and modern .NET code paths. Native support means fewer workarounds, cleaner test code, and less conversion overhead just to keep assertions readable.

More fluent collection assertions

This release adds BeEqualTo et NotBeEqualTo to collection assertions as a more fluent alternative to Equal.

That is a small API change with practical value. Test code reads more consistently, which improves maintainability across larger suites.

Better control over equivalency comparisons

Two new overloads, Excluding<T>() et Excluding(Type), make it easier to exclude all members of a certain type from equivalency comparisons.

This is especially useful when comparing complex object graphs where certain member types are noisy, irrelevant, or environment-specific. The result is less setup and more targeted assertions.

Clearer failure output for collection mismatches

ÊtreÉquivalentÀ now reports missing or extraneous items for differently sized collections.

That directly improves debugging speed. Instead of only seeing that a comparison failed, developers get clearer information on what is missing and what should not be there.

Diagnostics improvements that save time

The biggest leverage in this release is in failure analysis.

Le nouveau WithFullDump option can include the full contents of the subject-under-test in ÊtreÉquivalentÀ failure messages. Fluent Assertions code is also removed from stack traces when an assertion fails, and reporting is improved when chaining Throw avec Which.

These changes reduce noise and increase signal. In practice, that means less time tracing through framework internals and faster identification of the actual issue in the test or subject under test.

Precision improvements for time-based assertions

Fluent Assertions 8.9 also adds HaveMillisecond et NotHaveMillisecond for DateTime et DateTimeOffset.

For systems where timestamp precision matters, this gives teams a more direct and expressive way to validate time-based behavior.

Fix included in 8.9

This release also fixes a formatting exception that could occur when comparing strings containing braces.

That is a targeted fix, but one that removes an avoidable source of test instability and confusion.

Pourquoi cette sortie est importante

Fluent Assertions 8.9 is not about headline features. It is about removing friction from the testing workflow.

From broader support for Span<T> to more useful ÊtreÉquivalentÀ output and cleaner stack traces, the release improves the speed and clarity of everyday test work. That is the kind of update that compounds over time in active .NET codebases.

If your team values readable tests, faster debugging, and smoother assertion workflows, 8.9 is worth a close look.

Read the full release notes

Read the full release notes to see every feature, enhancement, and fix included in Fluent Assertions 8.9. 

Découvrez la bibliothèque de mots et PDF de Xceed paquet