Whats New
Improvements
MyClass
{
Property1 = blah
}
Potentially breaking changes
Extensibility changes
- Extensions for representing date and/or time values in fluent API
- Added string.Should().NotContain(), ContainEquivalentOf() and NotContainEquivalentOf()
- Added string.Should().BeBlank() and NotBeBlank()
- New wildcard-based assertions for strings using string.Should().Match() and MatchEquivalentOf()
- Added support for asserting that an object can be serialized and deserialized usign the binary formatter without loosing any data.
- Added support for asserting that an object can be serialized to and from its XML represnetation, without loosing data.
- Added support for asserting that a dictionary contains certain key and values
- Added support for specifying whether an exception message must match exactly, must contain a substring or match a wildcard pattern
- Added support for asserting that an object implementing IComparable<T> matches another object.
Improvements
- Refactored the property comparison assertions to use the correct assertion class for the individual properties. This gives the same kind of detailed reports for properties as you get for the individual types.
- Property comparison throws with a clear explanation when the type of equally named properties can not be converted
- The exception assertions will display the expected and the actual messages on separate lines so that it is easier to see the difference.
- When a string argument contains a newline or is longer than 6 characters, both the expected and the actual strings are displayed on a new line for easy visual comparison.
- Line breaks and other special characters are escaped.
- Replaced < and > for representing collections with the more common { and }
- If the object does not override ToString(), the entire object structure is displayed like this:
MyClass
{
Property1 = blah
}
- Ensured that items within a collection are also formatted properly
- Support null to null comparison for strings
- Collection assertions were optimized to prevent superfluous iterations
- When a different (inner) exception is thrown than the one that is expected, it include the Message property as well as the StackTrace
- object.Should().BeSameAs() now displays both objects if they are not the same
- Changed the test framework detection to scan for loaded assemblies instead of scanning the current directory
- The When() extension on exceptions will display the entire exception if the condition is not met
- Improved the documentation of the API
Potentially breaking changes
- Changed the behavior of the collection.Be(Not)SubsetOf() method. An empty set is now treated as a subset of ANY set.
- Changed the behavior of the collection.Be(Not)EquivalentTo() method. An empty set is now treated as equivalent to another empty set.
Extensibility changes
- Added support for a {reason} tag in the failureMessage of the Verification.FailWith method, so you can use the normal numbering for the failureArgs.
- Removed the use of Execute.Fail from the current assertions, and made this method Obsolete