Xceed Fluent Assertions Versioni

Scopri le novità in ogni release, con dettagli su funzionalità, miglioramenti e problemi risolti.

gen
feb
mar
apr
mag
giu
lug
ago
set
ott
nov
dic
Xceed Fluent Assertions V8.11.024 set 2026
Funzionalità
  • Added ThatSatisfy to MethodInfoSelector and PropertyInfoSelector.
  • Introduced new collection assertion methods BeSupersetOf, BeProperSubsetOf and BeProperSupersetOf, where an empty expected subset is treated as a valid (trivially satisfied) case for BeSupersetOf and BeProperSupersetOf instead of throwing.
  • Added BeJsonSerializable<T>() for .NET 6+ to assert System.Text.Json round-tripping, with overloads for equivalency options and JsonSerializerOptions.
  • Added HaveLineCount/NotHaveLineCount and ContainLine/NotContainLine to StringAssertions for asserting on the number of lines in a string and whether it contains a specific line, normalizing \r\n, \n and \r line endings. ContainLine returns an AndWhichConstraint exposing the matched line for further chaining.
  • Added Should() overloads for Func<ValueTask> and Func<ValueTask<T>>, so ValueTask-returning delegates support the same assertions as Task-returning ones.
  • Added public ValueTypeAssertions<TSubject, TAssertions> and NullableValueTypeAssertions<TSubject, TAssertions> base classes (both deriving from ValueTypeAssertionsBase<TSubject, TSubjectResult, TAssertions>) to make it easier to build custom assertions for value types — non-nullable subjects get Be/NotBe/Match, nullable subjects additionally get BeNull, NotBeNull, HaveValue, NotHaveValue and a nullable Match overload.
  • BeEmpty for IEnumerable<T> assertions now lists the first 10 items in the collection instead of only the first one.
  • Breaking Changes (for users)
    • Func<ValueTask> and Func<ValueTask<T>> used to bind to the synchronous Should<T>(Func<T>) overload, which treated the value task as an ordinary return value. They now bind to the new asynchronous overloads instead. Replace Throw, ThrowExactly, NotThrow and NotThrowAfter with their ThrowAsync, ThrowExactlyAsync, NotThrowAsync and NotThrowAfterAsync counterparts, and note that Subject now exposes a task-based adapter rather than the original delegate.
Correzioni
  • JsonNodeAssertions.HaveProperty/NotHaveProperty now correctly distinguish an absent property from one with an explicit null value.
  • JsonNodeAssertions.HaveProperty no longer throws an InvalidOperationException when wrapped in an AssertionScope and invoked on a non-JsonObject subject.
  • Fixed several PropertyInfoAssertions methods (BeVirtual, NotBeVirtual, BeWritable, NotBeWritable, BeReadable, NotBeReadable, Return, NotReturn) and TypeAssertions.HaveProperty/HaveIndexer throwing an intermediate NullReferenceException before they could produce their proper failure message when used inside an AssertionScope.
Xceed Fluent Assertions V8.10.017 ago 2026
Funzionalità
  • Added ComparingNullCollectionsAsEmpty and ComparingNullStringsAsEmpty options to BeEquivalentTo.
  • Now reports a descriptive failure when a selection rule targets a type that is being compared by value, including both:
    • Auto-detected value semantics (EqualityStrategy.Equals) when the type overrides Equals().
    • Explicit value semantics (EqualityStrategy.ForceEquals) when the user calls ComparingByValue().Significantly improved BeEquivalentTo for large unordered collections.
  • Now includes original index in extraneous item failure messages.
Xceed Fluent Assertions V8.9.026 gen 2026
Funzionalità
  • Added Excluding<T>() and Excluding(Type) overloads to exclude all members of a certain type from equivalency comparisons.
  • New overloads of BeXmlSerializable and BeDataContractSerializable that allow EquivalencyOptions to be configured, allowing the use of member selection rules.
  • Added extensive support for Span<T> / ReadOnlySpan<T> and Be(string) for Span<char> / ReadOnlySpan<char>.
  • Added BeEqualTo and NotBeEqualTo to the collection assertions as a more fluent alternative to Equal.
  • Added HaveMillisecond and NotHaveMillisecond assertion methods for DateTime and DateTimeOffset.
  • BeEquivalentTo will now report the missing or extraneous items for differently sized collections.
Correzioni
  • Fixed a formatting exception when comparing strings containing braces.
  • Removed FluentAssertions code from the stack trace when an assertion fails.