Fluent Assertions is finally gaining some momentum
The Agile Zone is brought to you in partnership with JetBrains. Learn how Agile Boards in YouTrack are designed to help teams plan, visualize and manage their work in an efficient manner, with support for both Scrum and Kanban processes.
Indeed it is, in particular within the part of the .NET community that believes test-first development is non-negotiable. We receive more and more suggestions, contributions and questions, and we’ve started to notice some blog posts here and there.
It’s not that it is being downloaded thousands of times per month, but since its first release in February 2010 it has been downloaded 1738 times through CodePlex. The biggest increase was caused by NuGet though. Since we’ve uploaded our first NuGet package in January this year, it counted 2863 downloads. That’s more than enough to make us happy.
Anyway, after having tested several intermediate versions in one of our major projects, we’ve finally released version 1.6.0. And yes, we’re doing semantic versioning, so this version should only add new functionality, bug fixes and no breaking changes compared to 1.5.0. All credits for this release go to my fellow colleague and close friend Martin Opdam. He spend more actual development time than me, and I’m very happy with that because it allows me to keep my focus on the Silverlight Cookbook for a while more. We are also happy to see that the contributions are coming as well. For instance, Urs Enzler has been quite active and provided various patches. He’s even trying to set us up with a continuous integration server based on TeamCity.
So what's new?
- And() extension method to TimeSpanConversionExtensions to support 4.Hours().And(30.Minutes()).
- More TimeSpan extensions to fluently create a TimeSpan like 23.Hours(59.Minutes()).And(20.Seconds()).
- MSpec as contributed by Urs Enzler.
- Support for the ComparisonMode to assert inner exception messages as well. Also added ComparisonMode Equivalent and EquivalentSubstring to assert that the message of an (inner) exception matches a certain case-insensitive phrase.
- Guid assertions like Be(), NotBe(), BeEmpty() and NotBeEmpty().
- Support for recursively comparing the properties of nested objects using ShouldHave().AllProperties().IncludingNestedObjects().EqualTo().
- Type and MethodInfo assertions for asserting class members are virtual or decorated with specific attributes.
- Before() and After() extensions methods for TimeSpans .
- Should().Be() and NotBe() extensions to the TypeAssertions.
- Added PDB files to the release build as another contribution by Urs Enzler.
- Added the name of the property to the ShouldFirePropertyChanged extension method failure message, also contributed by Urs Enzler.
- Added missing comments to some of the assertion classes.
What did we fix?
- Fixed a stack overflow exception due to a recursive call between the various overloads of floating point extension method BeApproximately()
- While comparing two collections for equality, FA didn't check any superfluous items in the expected collection.
- Boolean assertions did not properly check against null values.
- Fixed a stack overflow exception while creating a displayable representation of an object that contains circular references.
- Fixed some potential memory leaks fix in MonitorEvents() using a patch provided by Remo Gloor.
- Sometimes the wrong name of a the property or type was reported in a failure message.
- ShouldHave().AllProperties().EqualTo() sometimes treated two objects that are functional equivalent according to their Equals() override as different, simply because they were not of the same type.
- Fixed the detection of collection items that appear in the wrong order in Should().ContainInOrder().