Want to make unit testing easier? Check out Fluent Assertions. You can add this library to your C# Unit Tests in .NET Framework or .NET Core. To be clear, I’m just a fan of this library and I am not involved with it in any way.

Instead of assertions like these:

Assert.Equal(5, result.Count)

Assert.Equal(firstName, result)

Isn’t this better?

result.Count.Should().Be(5)

result.Should().Be(firstName)

But that’s just the start. There is plenty more to see. In this 5 Minute video, I’ll show you what you need to get started, it is really simple.

 

If you like this video, please subscribe to my YouTube Channel: youtube.com/schwammystreams

One thought on “Easier Unit Testing in C# with Fluent Assertions

  1. Pingback: Dew Drop – March 9, 2020 (#3149) | Morning Dew

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>