WithStrictTyping
and WithStrictTypingFor
to BeEquivalentTo
to ensure types also match - #3066 WithTracing
is safe when used with BeEquivalentTo
globally - #3067 ExcludingMembersNamed
to BeEquivalentTo
to exclude fields and properties anywhere in the graph - #3062
Should().Throw()
, ThrowAsync()
and ThrowWithinAsync()
flavors that don’t require a specific exception type - #3059 BeEquivalentTo
- #3049
WithMessage
for better readability - #3039 NullReferenceException
was thrown during subject identification - #3036 Which
- #3000
Should()
methods on reference types are now annotated with the [NotNull]
attribute for a better Fluent Assertions experience when nullable reference types are enabled - #2987
CompleteWithinAsync
treated a canceled task as an exception - #2853 Versions 8 and beyond are/will be free for open-source projects and non-commercial use, but commercial use requires a paid license. Check out the license page for more information.
Version 7 will remain fully open-source indefinitely and receive bugfixes and other important corrections.
NotBeIn
to check if a DateTime
is not in a given DateTimeKind
- #2536
Satisfy
method available to all reference types to allow for nested assertions - #2597
BeNaN
and NotBeNaN
for assertions on float
and double
- #2606
IValueFormatter
s to a (nested) AssertionScope
- #2676
XElement
- #2690
[Not]HaveElementWithValue
NotHaveElement
[Not]HaveAttribute
NotHaveAttributeWithValue
XDocument
- #2690
[Not]HaveElementWithValue
NotHaveElement
EquivalencyOptions
in string assertions - #2413
BeEquivalentTo
on object graphs or collections.
[CustomAssertionsAssembly]
attribute - #2389
Should()
methods on reference types are now annotated with the [NotNull]
attribute for a better Fluent Assertions experience when nullable reference types are enabled - #2380
.Which
construct will now amend the caller identifier - #2539
MethodInfoFormatter
and improved the PropertyInfoFormatter
- #2539
Excluding()
/ For().Exclude()
and Including()
on BeEquivalentTo()
now also accepts an anonymous object to include/exclude multiple members at once - #2488
BeEquivalentTo
via ExcludingExplicitlyImplementedProperties
- #2851 RaisePropertyChangeFor
to return a filtered list of events - #2677
WithMapping
was used in BeEquivalentTo
- #2860
WithStrictOrderingFor(x => x)
with BeEquivalentTo
- #2932 DataSet
, DataTable
, DataRow
and DataColumn
into a new package FluentAssertions.DataSet
- #2267
...OrEqualTo
methods - #2269
GenericCollectionAssertions
HaveCountGreaterOrEqualTo
: Use HaveCountGreaterThanOrEqualTo
HaveCountLessOrEqualTo
: Use HaveCountLessThanOrEqualTo
ComparableTypeAssertions
BeGreaterOrEqualTo
: Use BeGreaterThanOrEqualTo
BeLessOrEqualTo
: Use BeLessThanOrEqualTo
SimpleTimeSpanAssertions
BeGreaterOrEqualTo
: Use BeGreaterThanOrEqualTo
BeLessOrEqualTo
: Use BeLessThanOrEqualTo
ExecutionTimeAssertions
BeGreaterOrEqualTo
: Use BeGreaterThanOrEqualTo
BeLessOrEqualTo
: Use BeLessThanOrEqualTo
DefaultValueFormatter.SpacesPerIndentionLevel
property which was added during the development of v6, but wasn't removed before the release of v6 - #2281
AllSatisfy
now succeeds when asserting that an empty collection satisfies some predicates - #2321
OnlyContain
now succeeds when asserting that an empty collection matches some predicates - #2350
BinaryFormatter
- #2278
EquivalencyAssertionOptions
to EquivalencyOptions
EquivalencyAssertionOptions<TExpectation>
to EquivalencyOptions<TExpectation>
IEquivalencyAssertionOptions
to IEquivalencyOptions
SelfReferenceEquivalencyAssertionOptions<TSelf>
to SelfReferenceEquivalencyOptions<TSelf>
WithoutMatchingRules
and WithoutSelectionRules
while using BeEquivalentTo
- #2457
utcNow
overload for .Monitor<T>()
- #2629
BeLowerCased
/BeUpperCased
have been changed to align with the behavior of ToLower
/ToUpper
- #2660
HaveAttribute
to HaveAttributeWithValue
on XElement
- #2690
RespectingRuntimeTypes
to PreferringRuntimeMemberTypes
and RespectingDeclaredTypes
to PreferringDeclaredMemberTypes
- #2866
ExcludingNestedObjects
to WithoutRecursing
to better describe its purpose - #2876
HttpResponseMessage
. Use FluentAssertions.Web instead. - #2909
Configuration
and Services
into GlobalConfiguration
accessible through AssertionEngine.Configuration
and AssertionConfiguration.Current.Configuration
- #2901
app.config
file - #2901 ForConstraint
to IAssertionsScope
to support chaining .ForConstraint()
after .Then
- #2324
AsyncFunctionAssertions
into real base class - #2359
protected
.
GenericAsyncFunctionAssertions
has been moved to NonGenericAsyncFunctionAssertions
. NotThrow
and NotThrowAfter
from DelegateAssertions<TDelegate, TAssertions>
to ActionAssertions
- #2371
EquivalencyValidator
internal
- #2854 CompleteWithinAsync
treated a canceled task as an exception - #2853 Should()
methods on reference types are now annotated with the [NotNull]
attribute for a better Fluent Assertions experience when nullable reference types are enabled - #2987 BeEquivalentTo
where write-only properties would cause a NullReferenceException
- #2836 NSpec3
test framework - #2356
System.Configuration.ConfigurationManager
to 6.0.0 and System.Threading.Tasks.Extensions
to 4.5.4 - #2673 and #2855 BeEquivalentTo
where write-only properties would cause a NullReferenceException
- #2836 BeEmpty()
and BeNullOrEmpty()
performance for IEnumerable<T>
, by materializing only the first item - #2530 DateTimeOffset
with BeWithin(...).Before(...)
- #2312
BeEquivalentTo
will now find and can map subject properties that are implemented through an explicitly-implemented interface - #2152
because
and becauseArgs
were not passed down the equivalency tree - #2318
BeEquivalentTo
can again compare a non-generic IDictionary
with a generic one - #2358
FormattingOptions
were not respected in inner AssertionScope
- #2329
true
and false
in failure messages and make them formattable to a custom BooleanFormatter
- #2390, #2393
NotBeOfType
when wrapped in an AssertionScope
and the subject is null - #2399
BeWritable
/BeReadable
when wrapped in an AssertionScope
and the subject is read-only/write-only - #2399
ThrowExactly[Async]
when wrapped in an AssertionScope
and no exception is thrown - #2398
[Not]HaveExplicitProperty
when wrapped in an AssertionScope
and not implementing the interface - #2403
[Not]HaveExplicitMethod
when wrapped in an AssertionScope
and not implementing the interface - #2403
BeEquivalentTo
to exclude private protected
members from the comparison - #2417
BeEquivalentTo
on an empty ArraySegment
- #2445, #2511
BeEquivalentTo
with a custom comparer can now handle null values - #2489
AssertionScope(context)
create a chained context - #2607
AssertionScope
constructor would not create an actual scope associated with the thread - #2607
ThrowWithinAsync
not respecting OperationCanceledException
- #2614
BeEquivalentTo
with an IEqualityComparer
targeting nullable types - #2648 Be
, NotBe
and BeOneOf
for object comparisons with custom comparer - #2111
BeSignedWithPublicKey()
and BeUnsigned()
for assertions on Assembly
- #2207
NotContainItemsAssignableTo
for asserting that a collection does not contain any items assignable to a specific type - #2266 because
and becauseArgs
were not included in the error message when collections of enums were not equivalent - #2214
ToString
- #2144 ThrowWithinAsync
for assertions on Task
- #1974
AutoConversion
- #2147
WithoutStrictOrderingFor
- #2151 AssertionScope
- #2133
BeEquivalentTo
uses for recursive comparisons was 9 instead of the expected 10 - #2145
.Excluding()
and .For().Exclude()
not working if root is a collection - #2135
InvalidOperationException
when formatting a lambda expression calling a constructor - #2176 CompleteWithinAsync
when used with WithResult
and AssertionScope
- #2101
BeEquivalentTo
no longer crashes on fields hiding base-class fields - #1990
ThatAre[Not]ValueTypes
method for filtering the types - #2083
Imply
method to BooleanAssertions
- #2074
ThatAre[Not]Interfaces
method for filtering the types - #2057
ThatAre[Not]Abstract
method for filtering the types - #2058
ThatAre[Not]Sealed
method for filtering the types - #2059
ThatAre[Not]Abstract
methods to MethodInfoSelector.cs
for filtering the methods - #2060
ThatAre[Not]Abstract
, ThatAre[Not]Static
and ThatAre[Not]Virtual
properties for filtering in PropertyInfoSelector.cs
- #2054
BeOneOf
methods for object comparisons and IComparable
s - #2028
BeCloseTo
and NotBeCloseTo
to TimeOnly
- #2030
Exactly.Times(n)
, AtLeast.Times(n)
and AtMost.Times(n)
in a more fluent way - #2047
BeEquivalentTo
to treat record structs like records, thus comparing them by member by default - #2009 PropertyInfoSelector.ThatArePublicOrInternal
now takes the setter into account when determining if a property is public
or internal
- #2082
typeof(MyClass).Properties()
, now also includes static properties - #2054
ArgumentException
instead of ArgumentNullException
when a required string
argument is empty - #2023
string
s now uses ordinal comparison when an IComparer<T>
is not provided - #2075 ContainInConsecutiveOrder
and NotContainInConsecutiveOrder
assertions to check if a collection contains items in a specific order and to be consecutive - #1963
NotCompleteWithinAsync
for assertions on Task
- #1967
CompleteWithinAsync
and NotCompleteWithinAsync
for non-generic TaskCompletionSource
(.NET 6 and above) - #1961
ParentType
to IObjectInfo
to help determining the parent in a call to Using
/When
constructs - #1950
Monitor
to EventAssertions
to enable writing extension methods for event assertions. - #2008 Equals()
- #2006
BeCloseTo
- #2013 For
/Exclude
not excluding properties in objects in a collection - #1953
MatchEquivalentOf
to use CultureInfo.InvariantCulture
instead of CultureInfo.CurrentCulture
- #1985.
BeEquivalentTo
not taking into account any record
equivalency settings coming from the AssertionOptions
- #1984
ExecutionTimeOf
formatting failing when the expression includes - #1994 BeDefined
and NotBeDefined
to assert on existence of an enum value - #1888
DataSet.Tables
, DataTable.Columns
, DataTable.Rows
) have been restored - #1812
For
/Exclude
to allow exclusion of members inside a collection - #1782
HaveElement
for XDocument
and XElement
to assert on number of XML nodes - #1880 WithArgs
matching too many events when at least one argument matched the expected type - #1920 [Not]MatchRegex(string)
with [StringSyntax("Regex")]
which IDEs can use to colorize the regular expression argument - #1816
DateOnly
struct - #1844
TimeOnly
struct - #1848
NotBe
for nullable boolean values - #1865
MatchRegex()
to assert on the number of regex matches - #1869
EnumAssertions.Be
did not determine the caller name - #1835
ExcludingMissingMembers
doesn't undo usage of WithMapping
in BeEquivalentTo
- #1838
WithMapping
in BeEquivalentTo
now also works when the root is a collection - #1858 collection.Should().BeInAscendingOrder(x => x)
would fail - #1802 AllSatisfy
for asserting all items in a collection satisfy an inspector - #1790
WithMapping
option to BeEquivalentTo
to map members with different names between the subject and expectation - #1742 BeLowerCased
and BeUpperCased
for strings with non-alphabetic characters - #1792
new
- #1794
HaveAccessModifier
from correctly recognizing internal interfaces and enums - #1793
AssertionScope
s - #1797 ClearExpectation
- #1791 ThatAreStatic()
and ThatAreNotStatic()
for filtering in method assertions - #1740
HttpStatusCode
of an HttpResponseMessage
- #1737
WithInnerExceptionExactly
and WithInnerException
- #1769 ContainItemsAssignableTo
now expects at least one item assignable to T
- #1765
typeof(MyController).Methods()
, now also includes static methods - #1740
OccurredEvent
ordering on monitored object is now done via thread-safe counter - #1773
NullReferenceException
when testing an application compiled with .NET Native - #1776
[Not]Contain(key, value)
for dictionary-like enumerables incorrectly checked if the key was present - #1786
FormatException
when caller name determination returns an unformattable string - #1788 ThatAreAsync()
and ThatAreNotAsync()
for filtering in method assertions - #1725
ThatAreVirtual()
and ThatAreNotVirtual()
for filtering in method assertions - #1744
HaveCountGreaterThan()
, HaveCountGreaterThanOrEqualTo()
, HaveCountLessThan()
and HaveCountLessThanOrEqualTo()
- #1760 IEnumerable
s in parameter-less ContainSingle()
- #1753
HaveCount()
assertion message order to state expected and actual collection count before dumping its content` - #1760
CompleteWithinAsync
did not take initial sync computation into account when measuring execution time - 1762. GreaterOrEqualTo
and LessOrEqualTo
assertions, adding the word Than
- #1673
BeAsync()
and NotBeAsync()
are now also available on MethodInfoSelectorAssertions
- #1700 ImmutableArray<T>
- #1668
At
now retains the DateTimeKind
and keeps sub-second precision when using a TimeSpan
- #1687.
BeEmpty
assertion failure message - #1692.
ArgumentNullException
when formatting a lambda expression containing an extension method - #1696
IgnoringCyclicReferences
in BeEquivalentTo
now works while comparing value types using ComparingByMembers
- #1708
BeEquivalentTo
on a collection with nested collections would complain about missing members - #1713
BeEquivalentTo
by caching expensive Reflection operations - #1719 AndConstraint
- #1649
WithInnerExceptionExactly
extension method on Task<ExceptionAssertions<T>>
for easier use with ThrowAsync
- #1658 BeEquivalentTo
- #1660 WithOffset
extension method on DateTime
for easier creation of DateTimeOffset
objects - #1235.
collectionOfStrings.Should().NotContainMatch()
to assert that the collection does not contain a string that matches a wildcard pattern - #1246.
Using
/When
option on BeEquivalentTo
will now use the conversion rules when trying to match the predicate - #1257.
NotBeWritable
to PropertyInfoSelectorAssertions
to be able to assert that properties are not writable - #1269.
TaskCompletionSource<T>
- #1267.
IEqualityComparer<T>
through BeEquivalentTo(x => x.Using<MyComparer>())
- #1284.
NotBe
to BooleanAssertions
to be able to assert that a boolean is not the expected value - #1290.
DefaultValueFormatter
and EnumerableValueFormatter
suitable for inheritance - #1295.
IReadOnlyDictionary<TKey, TValue>
- #1298.
GenericAsyncFunctionAssertions
now has AndWhichConstraint
overloads for NotThrow[Async]
and NotThrowAfter[Async]
- #1289.
ReturnTypes
to MethodInfoSelector
to get all return types from all the methods selected
[Not]Be
to MethodInfoSelector
to check that methods [don't] have specified access modifier
ThatAre[Not]Classes
, ThatAre[Not]Static
selectors to TypeSelector
ThatSatisfy
to TypeSelector
to filter types with specified predicate
UnwrapEnumerableTypes
to TypeSelector
to get the T
type from types implementing IEnumerable<T>
UnwrapTaskTypes
to TypeSelector
to get the T
type for any type that are Task<T>
or ValueTask<T>
[Not]BeSealed
to TypeSelectorAssertions
collection.Should().NotContainEquivalentOf
to use object graph comparison rules to assert absence of an element in the collection - #1318.
[Not]BeInNamespace
and [NotBeUnderNamespace]
to TypeSelectorAssertions
- #1329.
Using
option on BeEquivalentTo
and on AssertionOptions.AssertEquivalencyUsing
now supports custom IOrderingRule
implementations #1337.
AllBe
to StringCollectionAssertions
to be able to assert that all strings in collection are equal to the specified string - #1332.
ForConstraint
method to AssertionScope
to open up OccurenceConstraint
for usage in custom assertion extensions - #1341.
NotContainInOrder
to CollectionAssertions
and StringCollectionAssertions
to be able to assert that the collection does not contain the specified elements in the exact same order, not necessarily consecutive - #1339.
Where
extension method to ExceptionAssertions
to be able to check asynchronously thrown exception - #1352.
[Not]BeUpperCased
and [Not]BeLowerCased
to StringAssertions
to be able to assert that a string is in upper or lower casing or not - #1357.
ObjectAssertions<TSubject, TAssertions>
to ease creation of custom assertion classes - #1371.
ComparingBy{Members,Value}(Type)
to allow specifying open generic types - #1389.
CollectionAssertions.NotBeEquivalentTo
that takes a config
parameter` - #1408.
StringAssertions.StartWith
, StringAssertions.EndWith
and their EquivalentOf
versions to allow empty strings - #1413.
Be
and NotBe
methods of DateTimeAssertions
and DateTimeOffsetAssertions
- #1427.
Enumerating
extension method to be able to force the enumeration of an object member -#1433
MatchRegex
and NotMatchRegex
that take System.Text.RegularExpressions.Regex
-#1436
DataSet
, DataTable
, DataColumn
, DataRow
, DataRelation
, Constraint
) - #1419.
WithParameterName
extension to ease asserting on the parameter name for a thrown ArgumentException
- #1466.
BeExactly
assertions to verify a DateTimeOffset
exactly, i.e both its date/time and its offset - #1609.
NotCompleteWithinAsync
to TaskCompletionSourceAssertions
- #1474.
HaveValue(decimal)
, HaveSameValueAs
and HaveSameNameAs
to EnumAssertions
- #1479.
WithResult
extension method to CompleteWithinAsync
assertions for Task<T>
and TaskCompletionSource<T>
- #1478.
Satisfy
to be able to compare a collection with a set of predicates in any order - #1500.
TimeSpan
- #1504.
AddReportable
overload to AssertionScope
for deferring reportable value calculation only on a test failure - #1515.
AssertionScope
- #1469.
BeInAscendingOrder
and BeInDescendingOrder
for collections taking a lambda expression - #1526
[Not]BeWritable
, [Not]BeSeekable
, [Not]BeReadable
, [Not]BeReadOnly
, [Not]BeWriteOnly
, [Not]HaveLength
, [Not]HavePosition
for Stream and [Not]HaveBufferSize
for BufferedStream - #1543
XDocument
, XElement
and XAttribute
properties and fields to BeEquivalentTo
- #1572
NotBe(string)
for symmetry with Be(string)
for GuidAssertions - #1597.
BeOneOf
for enum assertions - #1637
{{{{
or }}}}
{% endraw %} - #1234.
NotContainKeys
to honour the key comparer if applicable - #1233.
a - b == -30.Minutes()
#1313.
WithSender
and WithArgs
will only return the events that match the constraints - #1321
InvalidCastException
that BeEquivalentTo
could throw while debugging - #1325
Given
will no longer evaluate its predicate if the preceding FailWith
raised an assertion failure - #1325
RaisePropertyChangeFor
throws when the wrong property was detected - #1333
BeCloseTo
and BeApproximately
- #1386
Contain
, NotContain
and OnlyContain
to avoid multiple enumerations when the condition is false - #1421.
BeEquivalentTo
reported an incorrect message when a dictionary was missing a key - #1454
WhenTypeIs<T>
can use and how Using<T>
handles non-nullable types, see the Migration Guide for more details - #1494.
HaveElement
did not ignore the xml namespace - #1541
TypeAssertions
- #1550
[Not]HaveExplicitMethod
did not mention the parameters in the failure message - #1550
PropertyInfoAssertions
- #1558
MethodBaseAssertions
and MethodInfoAssertions
- #1559
AssemblyAssertions
- #1561
PropertyInfoSelectorAssertions
- #1565
MethodInfoSelectorAssertions
- #1569
XDocumentAssertions
, XElementAssertions
and XAttributeAssertions
- #1564
ForCondition
should not even evaluate its lambda when the previous assertion failed - #1587
Be(string)
for GuidAssertions - #1597.
AssertionScope
, ContinuedAssertionScope
, and GivenSelector<T>
methods. - #1606.
WithDefaultIdentifier
and WithExpectation
correctly when an AssertionScope
continues - #1610.
GenericEnumerableEquivalencyStep
in GenericCollectionAssertions
- #1615.
BeEquivalentTo
- #1631.
Match
for enum assertions - #1637
[Not]Have{Im,Ex}plictConversionOperator
(they had typos) - #1221.
NotBeAscendingInOrder
/NotBeDescendingInOrder
- #1221.
NotBeInAscendingOrder
/NotBeInDescendingOrder
instead. HasAttribute
, HasMatchingAttribute
and IsDecoratedWith(Type, bool)
Type
extensions - #1221.
IsDecoratedWith
/IsDecoratedWithOrInherits
instead. EquivalencyAssertionOptionsExtentions
internal
(and fixed a typo in the type name) - #1221.
ReferenceTypeAssertions.Subject
to be readonly
- #1229.
Subject
through the constructor instead. TypeAssertions.HaveAccessModifier
return type from AndConstraint<Type>
to AndConstraint<TypeAssertions>
- #1159.
TypeAssertions.NotHaveAccessModifier
return type from AndConstraint<Type>
to AndConstraint<TypeAssertions>
- #1159.
AllBeAssignableTo<T>
and AllBeOfType<T>
return type from AndConstraint<TAssertions>
to AndWhichConstraint<TAssertions, IEnumerable<T>>
- #1265.
TaskCompletionSource<T>
overlays the previously used assertions based on ObjectAssertions
.
[Not]BeCloseTo
for DateTime[Offset]
and TimeSpan
that took an int precision
- #1278.
TimeSpan precision
instead. Ordinal[Ignorecase]
- #1283.
AutoConversion
to convert using CultureInfo.InvariantCulture
instead of CultureInfo.CurrentCulture
- #1283.
StartWithEquivalent
and EndWithEquivalent
to StartWithEquivalentOf
and EndWithEquivalentOf
to make the API for Equivalent methods consistent - #1292.
IEventRecording
instead of IEventRecorder
- #1321
EventMonitor
and RecordedEvent
are now treated as internal
code - #1321
GetEventRecorder
of interface IMonitor
to GetRecordingFor
and will return IEventRecording
- #1321
Throw
, NotThrow
, CompleteWithin
, ...) #1324
SynchronizationContext.Current
while asserting asynchronous operations. In case hitting deadlocks in your tests please check whether you mix synchronous and asynchronous operations. #1324
[Not]HaveFlag
from ObjectAssertions
to EnumAssertions
- #1375.
Services.Configuration.TestFrameworkName
or "FluentAssertions.TestFramework"
now throws an exception instead of using the fallback - #1366.
[Not]Match
, [Not]MatchEquivalentOf
, [Not]MatchRegex
and [Not]ContainMatch
against null
or empty patterns - #1401.
WhichValue
to WhoseValue
- #1581
ComparingRecordsByValue
- #1571
becauseArgs
of [Not]Reference(Assembly)
from string[]
to object[]
- #1459
[Not]Contain(IEnumerable<T>, params T[])
- #1529.
BeEquivalentTo(params object[])
- #1529.
EquivalencyStepCollection
to EquivalencyPlan
and AssertionOptions.EquivalencyCollection
to EquivalencyPlan
- #1539.
BeEquivalentTo
will no longer include internal
properties and fields, unless IncludingInternalProperties
or IncludingInternalFields
is used - #1575.
protected
methods on DelegateAssertionsBase
such as Throw
and NotThrow
to avoid confusion - #1642
IMemberInfo.SelectedMemberInfo
to IMemberInfo
. Renamed IMemberInfo.SelectedMemberPath
to Path
and replaced SelectedMemberDescription
by a combination of Path
and Name
- #1379
[Not]Be
on an IComparable<T>
to use Equals(object)
instead of CompareTo(T)
and added [Not]BeRankedEquallyTo
to use CompareTo(T)
- #1177. CollectionAssertions
, ReferenceTypeAssertions
, MemberInfoAssertions
, MethodBaseAssertions
and MethodInfoAssertions
- #1229.
subject
instead. [Nullable]NumericAssertions<T>
to IComparable<T>
- #1266.
[Nullable]NumericAssertions.Subject
from IComparable
to T?
and T
, respectively - #1266.
Succeeded
and SourceSucceeded
from Continuation
and IAssertionScope
- #1325
FluentAssertions.Common
namespace internal
- #1376
IEquivalencyValidationContext
has undergone significant refactorings where its properties have been moved into the INode
hierarchy and the two Reason
and Tracer
classes - #1379
IMemberMatchingRule
, IMemberSelectionRule
and IOrderingRule
have been changed to replace their dependency on SelectedMemberInfo
to INode
and its derivatives IMember
- #1379
SelectedMemberInfo
class has been removed, since it main user, IMemberInfo
has been flattened - #1379
IMemberInfo
, but could also act on other objects than a property or field now take an IObjectInfo
- #1379
CallerIdentifier.logger
- #1458.
SelfReferenceEquivalencyAssertionOptions.orderingRules
- #1458.
ExceptionAssertions
from AssertionExtensions
to ExceptionAssertionsExtensions
- #1471.
Including(Expression<Func<IMemberInfo, bool>> predicate)
from EquivalencyAssertionOptions<T>
to SelfReferenceEquivalencyAssertionOptions<T>
- #1495.
Formatter.ToString()
and IValueFormatter
now work with a FormattingOptions
object that wraps the UseLineBreaks
option - #1469.
IEquivalencyValidationContext
into a new type Comparands
. This affected IEquivalencyStep
- #1539.
IEquivalencyStep.CanHandle
into Handle
and replaced Handle
's return value with a more clearer EquivalencyResult
- #1539
MemberSelectionContext
which is used by IMemberSelectionRule
to remove the need for extensions to understand the difference between run-time and compile-time types - #1539.
IEquivalencyStep
have moved to the FluentAssertions.Equivalency.Steps
namespace - #1588. This version was skipped.
string.Should().NotBeEquivalentTo
- #1134
collectionOfStrings.Should().ContainMatch()
to assert that the collection contains at least one string that matches a wildcard pattern - #1138
NotBeInAscendingOrder
and NotBeInDescendingOrder
that take a property expression - #1140
XDocument
s for equivalence - #1181
NotHaveSameCount
and HaveSameCount
for dictionary assertions - #1178
string.Should().Contain()
and string.Should().ContainEquivalentOf()
to test the number of times a phrase exists in a string using theString.Should().Contain("is a", MoreThan.Thrice())
- #1145
ValueTask
and ValueTask<T>
- #1158
SatisfyRespectively
on all collections, including collections of string
- #1201 CompleteWithin
works on Func<Task>
and not on Task
directly - #1127.
NotBeAscendingInOrder
and NotBeDescendingInOrder
to NotBeInAscendingOrder
and NotBeInDescendingOrder
(in a non-breaking way) - #1140
null
s where not properly treated as equivalent by BeEquivalentTo
- #1143
BeEquivalentTo
now allows selecting an explicit interface member over a regular instance member when using RespectingDeclaredTypes
and the expectation type is an interface - #1144
System
and don't match on partial namespace segments - #1193
BeEquivalentTo
on an XDocument
could report the incorrect path to a self-closing XML tag - #1170
BeEquivalentTo
on multi-dimensional arrays with empty elements could cause an internal error - #1167
ThatAreUnderNamespace
handles types in the global namespaces correctly - #1197
BeEquivalentTo
on normal Tuple
s should use structural equivalency instead of treating them as value types - #1206
ConfigurationManager
. This is now handled more gracefully - #1210
System.Xml.Linq
for .NET 4.5/4.7 - #79
Thanks to contributors Ronald Kroon, Daniel Petrov, @david-a-jetter, Lukas Grützmacher and Ben Randall.
And special thanks to Matthias Koch to switch us over to the awesome Nuke build system.
Match
method to (nullable) numeric assertions - #1112 IAssertionStrategy
with an AssertionScope
did not always capture all assertion failures - #1118
null
arguments are handled with clearer exception messages - #1117 Special thanks to contributors @liklainy and Amaury Levé.
AssertionScope
while running many async
tests concurrently - #1091
IAssertionStrategy
for the assertion scope, for instance, to create screenshots when a test fails - #1094 & #906.
Excluding
with BeEquivalentTo
did not always work well with overridden properties - #1087 & #1077
FormatException
when a nested message contains braces - #1092
(Not)BeAssignableTo
failure messages - #1104 & #1103
Kudos to conklinb and Amaury Levé for notable contributions and my partner-in-crime Jonas Nyrup for some of the fixes, a lot of (internal) quality improvements and his critical eye.
SatisfyRespectively
on collections - #1043
Invoking
and Awaiting
for different sets of generic parameters - #1051
NotThrowAfter
is now also available for .NET Standard 1.3 and 1.6 - #1050
CompleteWithin
to assert asynchronous operations complete within a time span - #1013/#1048
NotBeEquivalent
for objects - #1071
WithMessage()
for async
exception assertions - #1052
100.Nanosecond()
and 20.Microsecond()
to represent time spans - #1069 AllBeAssignableTo
and AllBeOfType
did not work for list of types - #1007
BeOfType
does not attach to the AssertionScope
correctly - #1002
NotThrow(After)
in chained AssertionScope
invocations - #1031
BeEquivalentTo
- #1033
AggregateException
s - #1041
BadImageFormatException
under the .NET Core 3.0 Preview - #1057
ThrowExactly
and ThrowExactlyAsync
now support expecting an AggregateException
- #1046 Kudos to Lukas Grützmacher, Matthias Lischka, Christoffer Lette, Ed Ball, David Omid, mu88, Dmitriy Maksimov and Ivan Shimko for the contributions and Jonas Nyrup to make this release possible again.
AssertionOptions(o => o.WithStrictOrdering())
-#974
ContainEquivalentOf
- #950
Should().NotThrowAfter
assertion for actions - #942 Kudos to @BrunoJuchli, @matthiaslischka and @frederik-h for these amazing additions.
BeEquivalenTo
- #935
AssertionScope
to ensure binary compatibility - #977 BeEquivalentTo
to handle a non-generic collection as the SUT - #975, #973
IncludeMemberByPathSelectionRule
- #969 ThrowAsync
, ThrowExactlyAsync
and NotThrowAsync
- #931
Should().Throw
and Should().NotThrow
for Func<T>
- #951
private protected
access modifier - #932
BeApproximately
to support nullable types for both the subject and the expectation nullable - #934
async
version of ExecutionTime
to - #938
NotBeApproximately
to accepting nullable subject and expectation - #939
type.Should().Be(type)
now support open generics - #954, #955 Should().AllBeEquivalentTo()
- #920, #914
BeEquivalentTo
with WithStrictOrdering
produced messy failure message - #918
null
subject to a dictionary - #933
IEnumerable
now works now as expected - #911
new
overrides - #960, #956 Note In versions prior to 5.5, FA may have skipped certain properties in the equivalency comparison. #960 fixes this, so this may cause some breaking changes.
Lots of kudos @jnyrup and @krajek for a majority for the work in this release.