Quantcast
Channel: Fluent Assertions
Browsing all 1402 articles
Browse latest View live

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 Article


Created 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 Article


Source code checked in, #8b5ebba9c800

Updated the main version to 2.1.0

View Article

New 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 Article

Commented 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 Article


New 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 Article

New 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 Article

New 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 Article


New 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 Article


New Post: Comparing two IEnumerables for Properties is not working

Don't worry about that. As long as you're a happy user ;-)

View Article

New 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 Article

Reviewed: 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 Article

Commented 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 Article


Commented 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 Article

Commented 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 Article


New 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 Article

New Comment on "Documentation"

Typo: "Action act = () => subject.Foo2("Hello"); Act.ShouldThrow<InvalidOperationException>() .WithInnerException<ArgumentException>() .WithInnerMessage("whatever");" The variable is...

View Article


Commented 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 Article

Commented 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 Article

New 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
Browsing all 1402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>