NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #86 most downloaded on NuGet
A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Works with .NET Standard 2.0 and higher, .NET Framework 4.7 and higher and .NET 6 and higher. Supports the unit test frameworks MSTest2, MSTest3, MSTest4, NUnit3, NUnit4, XUnit2, XUnit3, MSpec and TUnit. IMPORTANT: This version is free for open-source projects and non-commercial use, but commercial use requires [a paid license](https://xceed.com/products/unit-testing/fluent-assertions/). Check out the [license page](LICENSE) for more information.
Latest stable
8.11.0
Last release 2 months ago
14 Sep 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
24 versions withdrawn
withdrawn after publishing
127 years old
135 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
{New} Supports .NET 4.5.0, .NET Standard 1.4, 1.6 and 2.0
NotBeInRange, NotHaveSameCount, NotApproximately, NotBeAssignableTo to the numeric assertions - #598, #599, #600, #601[Not]Have{Implicit,Explicit}ConversionOperator, NotBeDecoratedWith and ThatAreNotDecoratedWith to the type assertions - #604, #609NotHaveCount, HaveCount{Greater,Less}{Than,OrEqualTo} to the numeric assertions - #618collection.Should().NotContainNulls - #608OnlyHaveUniqueItems and NotContainNull collection assertions - #611NotIntersectWith, NotBeSubsetOf, NotHaveSameCount ,NotBeEquivalentTo - #610BeCloseTo with TimeSpan - #621HaveCount variants for generic collections - #623string.ContainAllOf and string.ContainAnyOf to verify a string against a collection of strings - #633TimeSpan conversions - #650TimeSpan extensions for micro and nano seconds - #669BeEquivalentTo that takes a params array - #733BeDecoratedWithOrInherit and NotBeDecoratedWithOrInherit for type assertions - #727Should().[Not]Throw is used on async void action - #737ThatAre[Not]DecoratedWithOrInherit - #748unsigned types and sbyte - #750collection.Should().OnlyHaveUniqueItems - #607ThatAreDecoratedWith to attributes - #642ShouldBeEquivalentTo, ShouldAllBeEquivalentTo and collection.Should().BeEquivalentTo - #593BeEquivalentTo and provided an opt-in API WithAutoConversion instead - #616MonitorEvents API with a new Monitor extension method that will return a thread-safe monitoring scope that exposes methods like Should().Raise() and metadata such as OccurredEvents and MonitoredEvents - #625Should[Not]Throw() to Should().[Not]Throw in order align all APIs - #648IValueFormatter contract to better support cyclic reference detection (#649)ExecutionTime[Of] with the rest of the v5.0.0 API by using Should() to assert - #653WithInnerMessage as chaining WithInnerException with WithMessag gives the same result - #666DateTime & Timespan construction to the 'Extensions' namespace - #675Equals to have value semantics and added ComparingByValue and ComparingByMembers - #740ISubjectInfo to IMemberInfo to better reflect its purpose - #747Task and Task<T> - #651Where on WithInnerExceptionExactly should work on the correct type - #656BeDataContractSerializable didn't allow customizing the comparison - #667DateTime, DateTimeOffset, and TimeSpans - #669Types who both happens to be null, NotBe() and Be() should still work as expected - #672DateTime formatting for near-zero values - #695TargetInvocationExceptions to improve the failure messages in equivalency assertionsReferenceEquals on NotEqual - #606Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
{Fix} Fixes a crash when a failing equivalency assertion involves a Guid - #613, #619
{Fix} Fix issues with curly braces in exception messages - #582
{Fix} HaveDefaultConstructor throws InvalidOperationException if the type has both a default constructor and a static constructor - #540
HaveDefaultConstructor throws InvalidOperationException if the type has both a default constructor and a static constructor - #540Nothing published for this version
{Fix} Adapted the TimeSpan formatter to support time spans between 0.1 microseconds and 1 millisecond - #513
TimeSpan formatter to support time spans between 0.1 microseconds and 1 millisecond - #513JTokenAssertions.BeEquivalentTo now formats the JSON document in a more readable fashion - #453EventArgs - #30BeOfType and NotBeOfType for value type objects - #459ShouldBeEquivalentTo - #529{New} Ensured that the assembly assertions also include those inherited from ReferenceTypeAssertions - #501
ReferenceTypeAssertions - #501Should().MatchRegex() and Should().NotMatchRegex() to get syntax highlighting and error analysis - #511AllBeOfType and AllBeAssignableTo to the collection assertions - #428BeNull/NotBeNull as an alternative for HaveValue/NotHaveValue for nullable built-in value type - #495{Changed} ContainSingle will list the actual items in the enumerable upon failure - #346
ContainSingle will list the actual items in the enumerable upon failure - #346{New} Added new Should().BeIn(DateTimeKind) extension to assert that DateTime objects are in the expected kind (Utc, Local or Unspecified) - #492
Should().BeIn(DateTimeKind) extension to assert that DateTime objects are in the expected kind (Utc, Local or Unspecified) - #492AsLocal and AsUtc extensions to fluently specify the DateTimeKind when creating date time values - #492{New} Added non-generic BeAssignableTo to reference type and Type assertions - #483
BeAssignableTo to reference type and Type assertions - #483async/await exception assertions - #484{Changed} Added _because_ parameters to ShouldThrowExactly and ShouldThrow - #456
ShouldThrowExactly and ShouldThrow - #456Should().BeOfType - #458{Fix} Ensure failure with a good message if ShouldBeEquivalentTo compares dictionaries against null - #469
ShouldBeEquivalentTo compares dictionaries against null - #469ShouldBeEquivalentTo it should start evaluation at the root - #462{Changed} Numbers are now formatted in such a way that their type is visible. Floating point numbers are formatted with their full precision - #445 -
IComparer<object> object - #451 - @TaffarelJr{New} @jeroenpot added BeOneOf to DateTime and DateTimeOffset assertions - #440
BeOneOf to DateTime and DateTimeOffset assertions - #440IEnumerable<T> collections - #438{Change} Added explicit extension methods for JSon.NET to disambiguate between JTokenAssertions and ObjectAssertions - #402 and #405
JTokenAssertions and ObjectAssertions - #402 and #405{New} @MortenBoysen added NotContain(s) overloads to the collection and dictionary assertions - #432
NotContain(s) overloads to the collection and dictionary assertions - #432{Fix} ContainSingle didn't honor the reason - #425
{New} Added negating overloads to the DateTimeOffset assertions - #418
DateTimeOffset assertions - #418{New} Added inverse methods (a.k.a. Should().NotXxxx) to all DateTime assertions - #414
Should().NotXxxx) to all DateTime assertions - #414{New} Added support for NotBeOfType - #413
NotBeOfType - #413ISubjectInfo for checking setter and getter access modifiers - #331SelectedMemberInfo - #331NullReferenceException occurred from ShoulddotThrow when exception doen not have the expected inner exception - #415{Fix} Structurally comparing null-valued enums by value didn't include the property path.
{Fix} Structurally comparing null-valued enums by value causes unexpected results - #409 #388
{New} Added Json project & specs - #403
{New} @mkoertgen added a new set of APIs for asserting against Json (through NewtonSoft.JSon) - #369
{New} Added BeDataContractSerializable - #396
BeDataContractSerializable - #396{New} Extended the semantic equivalency API that was introduced in 4.2.0 with support for XDocument and XElement - #386
XDocument and XElement - #386XmlElement and XmlNode - #392ShouldAllBeEquivalentTo - #385{Fix} Ensured that the xUnit 2 assembly is loaded explicitly - #373
{Fix} Ensured that the xUnit 2 assembly is loaded explicitly - #373
{Fix} Comparing two empty collections resulted in a weird failure fixes - #382.
{New] Added support for semantically comparing XML nodes and documents using node.Should().BeEquivalentTo(node) - #356
collection.Should().StartWith and EndWith that supports a sequence of elements - #374The ComparingByValue option didn't work when comparing two collections using ShouldAllBeEquivalenTo.
ComparingByValue<T> option didn't work when comparing two collections using ShouldAllBeEquivalenTo.Fixed a compatibility issue with XUnit for Devices - #322
Added datetime.Should().BeSameDateAs() - #319 (by @blairconrad)
datetime.Should().BeSameDateAs() - #319 (by @blairconrad)dictionary.Should().Contain() and NotContain that take an enumerable of KeyValuePairss - #342 (by @jbattermann)ShouldBeEquivalentTo will only include properties which name is an exact match - #329dictionary.ContainKeys(..) had a non-optional because argument and so did ContainValuesAndWhich - the later for reasonArgs which was/is inconsistent with the rest - #333 (by @jbattermann)MonitorEvents to monitor events for implemented interfaces or base classes only - #330 (by @gstamac)Event monitoring will now work in multi-threaded unit test frameworks such as XUnit 2
Ensured that projects targeting win81 or wpa81 don't use the 'dotnet' profile (#295 and #311)
WithoutStrictOrderingFor to specify that certain collection properties should not compared using strict ordening (#306)NotBeDecoratedWith attribute assertion (#300)collection.Should().Equal() to support comparing different types of collection using a predicate (#297)Fixes failure when reasonArgs contain "{" or "}"
Adds support for .NET 4.6, CoreCLR, .NET Native and Universal Windows Apps for Windows 10
[Obsolete]:
StringCollectionAssertions.Contains(IEnumerable<string>, string)StringCollectionAssertions.Contains(IEnumerable<string>, IEnumerable<string>)CollectionMemberSubjectInfo.PropertyInfo, PropertyPath, PropertyDescriptionEquivalencyAssertionOptions.Empty and Default which are replaced by the AssertionOptions classIMatchingRule, which is replaced by IMemberMatchingRuleISelectionRule, which is replaced by IMemberSelectionRuleISubjectInfo no longer has properties for getting information about properties since that was replaced with the more general member properties.SelfReferenceEquivalencyAssertionOptions no longer has methods to include/exclude properties, but provides methods for selecting members instead.Nothing published for this version
- #271 - Added a large number of assertions to verify the assembly and type structure in unit tests (piotrpMSFT) - #200 - Added an alternative to Whic
Which named SubjectSubject is null in numeric assertions (sietsevdschoot)- #282 - Fixed a stack overflow issue while determining the compile-time type … contributed by Dennis Doomen (dennisdoomen) - #281 - Enabled the use o
Important ShouldBeEquivalentTo contained a bug that was causing false positives. If you are experiencing failing unit tests after upgrading to v3.4.0,
DateTime and DateTimeOffset assertions contributed by Dennis Doomen (dennisdoomen)Important
ShouldBeEquivalentTo contained a bug that was causing false positives. If you are experiencing failing unit tests after upgrading to v3.4.0, make sure you use the IncludingAllRuntimeProperties option to include the run-time properties and not just the ones declared.
The first steps have been taken to deprecate IAssertionRule.
New features
CompareEnumsAsString and CompareEnumsAsValue to the options taken by ShouldBeEquivalentTo so specify how enumerations are compared.ShouldThrowExactly and WithInnerExceptionExactly to assert a specific exception was thrown rather than the default of allowing sub-classes of those exceptions. #176AssertionOptions class that can be used to change the defaults used by ShouldBeEquivalentTo, alter the global collection of IEquivalencySteps that are used internally, and change the rules that are used to identify value types. #134ShouldBeEquivalentTo will now also include public fields. Obviously, this can be changed using a set of new members on the EquivalencyAssertionOptions<T> class that the equivalency API takes.StartWith, EndWith, HaveElementPreceding and HaveElementSucceeding.ThatAreDecoratedWith, ThatAreInNamespace, ThatAreUnderNamespace, ThatDeriveFrom and ThatImplement to filter types from assemblies that need to comply to certain prerequisites.BeAssignableTo that directly apply toType objects.Minor improvements and fixes
4.Ticks()IDictionary<T,K> more than once, ShouldBeEquivalentTo will fail rather than pick a random implementation. Likewise, if a dictionary only implements IDictionary<,> explicitly, it will still be treated as a dictionary. Finally, ShouldBeEquivalentTo will now respect the declared type of a generic dictionary.ShouldBeEquivalentTo.ShouldBeEquivalentTo did not respect the declared type. #161collection.ContainSingle() having no arguments.DateTimeOffset. #160collection.Should().BeEmpty() now properly reports the collection items it found unexpectedly. #224AssertFailedException serializable to help in certain cross-AppDomain unit tests. #214TimeSpan's MinValue and MaxValue without causign stack overflow exceptions. #212[UITestMethod]. #223ShouldBeEquivalentTo would throw an internal exception on a unset byte[] property. #165Internal changes
IAssertionRule.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.