Using Assertion Scopes to execute multiple Assertions in C#

Using Assertion Scopes to execute multiple Assertions in C#

Fluent Assertions is a .NET library that provides use with a bunch of useful extension methods that allow us to test our C# code in a more natural way. Let’s say for example we are testing the output of a string. Without Fluent Assertions, we might write something like this: string testString = "hello"; string expectedOutput = testString.ToUpper(); Assert.Equal(expectedOutput, "HELLO"); If we were to write this test using Fluent Assertions, we could do so like this:...

June 27, 2023 · 4 min · Will Velida