Updated Wiki: Documentation
For the 1.7.1 release, click here. Supported Test Frameworks Fluent Assertions supports MSTest, NUnit, XUnit, MSpec, MBUnit and the Gallio Framework. You can simply add a reference to the...
View ArticleNew Post: GenericCollectionAssertions BeInOrder/NotBeInOrder
Any ideas how to combine these when dealing with nested collections? Meaning, say I wanna do this:...
View ArticleNew Post: GenericCollectionAssertions BeInOrder/NotBeInOrder
In the 1.7.x version you can't change the way collections are compared. But in the 2.0 beta you can. Read this blog post to learn more about that:...
View ArticleCreated Issue: BeNull and NotBeNull have the same condition for comparable...
I have a reference type implementing IComparable<T> that I assert to be null:value.Should().BeNull();The test unexpectedly fails when the value is indeed null (verified in the debugger). When I...
View ArticleCreated Issue: Support BeDecoratedWith on a collection of Types [12457]
Proposed syntax:AllTypes.From(permitVisionAssembly) .ThatImplement<INotifyRuleViolation>() .Should().BeDecoratedWith<ExceptionHandlingAttribute>();
View ArticleEdited Issue: BeNull and NotBeNull have the same condition for comparable...
I have a reference type implementing IComparable<T> that I assert to be null:value.Should().BeNull();The test unexpectedly fails when the value is indeed null (verified in the debugger). When I...
View ArticleEdited Issue: BeNull and NotBeNull have the same condition for comparable...
I have a reference type implementing IComparable<T> that I assert to be null:value.Should().BeNull();The test unexpectedly fails when the value is indeed null (verified in the debugger). When I...
View ArticleCommented Feature: float/double.Should().Be is missing [11704]
It seems that Be() is missing for float/double numbers.2.5.Should().Be doesn't exist...If this is by design how do I confirm float/double property exactly equals to a number?Comments: but what if I...
View ArticleCommented Issue: Fluent assertions v1.7.1 fails to compare nullable timespans...
Not tested with latest version. It seems that an overload on SimpleTimeSpanAssertions which accepts a Nullable<TimeSpan> is missing. I was able to work around this by writing the next extension...
View ArticleSource code checked in, #953faa8d5d08
Fixed issue #12460 (TypeAssertions throws NullReferenceException when checking Should().Be(null))
View ArticleNew Post: Subject has property Subject that the other object does not have
I must be doing something wrong or missed some documentation. I have two DTO's that I am comparing and they are both the same as far as I can see in the debugger. However when I try...
View ArticleNew Post: Subject has property Subject that the other object does not have
I guess I solved it by shortening the statements ResultDto[i].ShouldHave().AllProperties().EqualTo(controlDto[i]); works.
View ArticleNew Post: Subject has property Subject that the other object does not have
This is by design (although I understand your confusion). The And property returns a FA-specific type that you are then comparing with controlDto[I]. We're thinking to remove the And construct since it...
View ArticleNew Post: Subject has property Subject that the other object does not have
I think the AND is pretty cool. Not sure I'd remove it on my account. I figured out a solution and I'm happy. Thanks for the reply thought. Happy coding!
View ArticleNew Post: ShouldAllBeEquivalentTo() and ordering
Hello, With the new extensions, is there a quick way to do something comparable to the collection assertion ShouldAllBeEquivalentTo(), but where order is taken into account? I was expecting an option...
View ArticleNew Post: ShouldAllBeEquivalentTo() and ordering
I'm not sure if I understand you correctly. If you use someCollection.ShouldAllBeEquivalentTo(otherCollection), then the order is important. Each item in the collection should be equivalent to the same...
View ArticleNew Post: ShouldAllBeEquivalentTo() and ordering
Aha, you are correct. Because of the wording (see CollectionAssert.AreEquivalent), I presumed that order was not important. I did test my presumption, but I made a mistake in my test. In that case, is...
View ArticleNew Post: ShouldAllBeEquivalentTo() and ordering
Hmm, for individual properties that is just a matter of overriding the comparison such as explained in http://www.dennisdoomen.net/2012/09/asserting-object-graph-equivalence.html. But at the top-level,...
View Article