Posts about FluentAssertions

Comparing JSON strings in unit tests

What is the best way to assert a JSON string value in a unit test? You can compare them as strings, but for that to work you need to use consistent formatting that ensures the same data is always serialized into identical JSON, for example something like the JSON Canonical Form. But there are other options as well.

Creating a Custom IAssertionRule for FluentAssertions

November 17th 2014 FluentAssertions Unit Testing

The more I use FluentAssertions, the more I like its flexibility and extensibility. In this post I'm going to focus on assertion rules which can be used to define custom equality comparisons for specific types.

Customizing Comparisons in FluentAssertions with Options

November 3rd 2014 FluentAssertions Unit Testing

Unit tests best serve their purpose when they are brief and easy to understand. There are cases when it can be difficult to achieve this; nevertheless it's still worth putting in the effort, as it may pay off.

FluentAssertions: Make Your Unit Tests Easier to Write and Understand

September 29th 2014 FluentAssertions Unit Testing

When working with complex data structures in your unit tests, you often end up with a lot of plumbing code. FluentAssertions is a library for .NET framework which can simplify your assertion code and at the same time make the error messages much clearer when tests fail.