New Post: Throw custom exception on failed assertions
Hi,The library hasn't been designed for that, but the actual exception class that is thrown upon a verification failure was designed to be pluggable. Unfortunately, the AssertionHelper class is...
View ArticleCreated Issue: ShouldNotThrow hides stack trace of thrown exception [12473]
When an assertion of the `ShouldNotThrow` family of extension methods fails, the specifics of where in the SUT the exception was thrown is lost. This makes it hard to diagnose because you either need...
View ArticleNew Post: asserting the value of an xml element
lets say i have the following xml<contacts><contact><name>Bob</name><addresspostalAddress="true"><street>123 Smith...
View ArticleCommented Issue: add new string assertion .Should().BeInFormat(format, args)...
This is similar to wildcards, but I think it will be useful too. If maintainers says ok for that I will be happy to contribute an implementation.Comments: Sounds like a nice addition.
View ArticleNew Post: Mappings in object graph comparisons
I have a couple of object graph comparison cases that I'm struggling to set up with the Fluent Assertions library. Both involve some level of advanced mapping from an object (and Entity Framework...
View ArticleNew Post: Mappings in object graph comparisons
Hi leoghann,Thanks for taking the time to properly formulate your question. What you might want to do is use theUsing-When methods of the options object. The EquivalencySpecs you'll find some examples...
View ArticleNew Post: asserting the value of an xml element
Hi nitro52,Sorry for the delayed response. Unfortunately, it is not yet possible to verify the contents of a particular element. As an alternative, you could do something similar by finding the...
View ArticleNew Post: name or description of the object being tested?
You can provide some context about the subject-under-test you are asserting by setting the static Verification.SubjectName property. However, you must make sure you set that property to null to prevent...
View ArticleNew Post: Comparing two IEnumerables for Properties is not working
Don't worry about that. As long as you're a happy user ;-)
View ArticleNew Post: Mappings in object graph comparisons
I did see the Using-When examples. For a single object, it looks I could do something like this: orderDto.ShouldBeEquivalentTo(order, options => options .Using<string>(ctx =>...
View ArticleReviewed: Release 2.0.0 (Dec 30, 2012)
Rated 5 Stars (out of 5) - Thank you for making our lives easier! I've been using this project for along time and it's just such a wonderful thing to work with, thanks a million!
View ArticleCommented Issue: Fluent Assertions should not format exceptions using the...
We use a custom ApplicationErrorException which implements IEnumerable returning a list of parameters associated with that exception.When the verification fails Fluent Assertions formats the exception...
View ArticleCommented Issue: BeOfTypeImplements to test IEnumerable instead of specific...
Unit tests for my controller include type validation of the model.I first attempted:ViewResult.Model.Should().BeOfType<IEnumerable<model>>()but it failed, stating that the type is...
View ArticleCommented Issue: Output text of a collection assertion should be more...
The output text of a collection assertion (Should().BeEquivalentTo()) should describe specific differences in objects like ShouldHave().AllProperties().EqualTo() does.Comments: Sorry for not getting...
View ArticleNew Post: ShouldBeEquivalentTo method still relies on override of...
I have a class, let's call it Foo, that is a value type and hence overrides the Equals/GetHashCode() methods. In a separate test fixture, I want to assert thatall the properties on Foo have been set...
View ArticleNew Comment on "Documentation"
Typo: "Action act = () => subject.Foo2("Hello"); Act.ShouldThrow<InvalidOperationException>() .WithInnerException<ArgumentException>() .WithInnerMessage("whatever");" The variable is...
View ArticleCommented Issue: CollectionAssertions.HaveCount never calls Count property,...
FIrst off, I'm checking out your repo and I'll supply a fix with this issue... tagged in a pull request?Gents, public AndConstraint<TAssertions> HaveCount(int expected, string reason = "", params...
View ArticleCommented Issue: CollectionAssertions.HaveCount never calls Count property,...
FIrst off, I'm checking out your repo and I'll supply a fix with this issue... tagged in a pull request?Gents, public AndConstraint<TAssertions> HaveCount(int expected, string reason = "", params...
View ArticleNew Post: I want to test for property value by property name
I'm trying to use FluentAssertions together with SpecFlow.And I want to be able to have statements which say: the <propertyName> should have <value> As such I want to compare 2 objects to...
View Article