19
  • Can someone point the differences?

The above is really my question, but if you can also share your experience with them and why you use one or the other.

AlvaroAV
  • 10,335
  • 12
  • 60
  • 91
Luis
  • 1,840
  • 2
  • 14
  • 14

3 Answers3

26

They are just two different libraries, so just look at the features, and especially at the reporting capabilities and take your pick.

As I am the author of Fluent Assertions, I'm obviously biased. Regardless, I take big pride in the effort we've been putting in making the error messages as clear as possible so that we can keep you out of the debugger hell.

AlvaroAV
  • 10,335
  • 12
  • 60
  • 91
Dennis Doomen
  • 8,368
  • 1
  • 32
  • 44
  • 3
    It would be in particular interesting to hear from the author, which features of your library are better than in competitors library. – Michael Freidgeim Oct 29 '18 at 10:16
  • 6
    I would say that the structural comparison API is one of the most powerful features of Fluent Assertions that the other libraries (still) don't have. AFAIK, there's nothing in Shouldly that Fluent Assertions does not have as well. See also https://fluentassertions.com/documentation/#object-graph-comparison – Dennis Doomen Nov 07 '18 at 14:13
  • 2
    The documentation has moved to https://fluentassertions.com/objectgraphs/ – M.Stramm Mar 26 '20 at 09:15
  • 2
    @DennisDoomen It (now) exists in Shouldly as well: `actual.ShouldBeEquivalentTo(expected)` – Tom Pažourek Jul 09 '21 at 12:54
  • I'm pretty sure it doesn't compare to what Fluent Assertions has to [offer](https://fluentassertions.com/objectgraphs/). It took us years to get where it is now. – Dennis Doomen Jul 09 '21 at 20:14
3

SA-'s example of FluentAssertions is incorrect. The examples should be:

  • FluentAssertions: variable.Should().Be(10);
  • Shouldly: variable.ShouldBe(10);

As you can see there is barely any difference in usage for this simple example.

I've found FluentAssertions to be the slightly more hands on, but more powerful library, with Shouldly lacking some features. The error messages of Shouldly are indeed a bit better with using natural language, but I wouldn't go as far as say they're less technical.

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
Alexander
  • 51
  • 1
  • 2
0

I think you can find your answer by this comparision

they are in many metrics side by side or FluentAssertion a little better

compare shouldly and fluentassertion