Top "Fluent-assertions" questions

Fluent Assertions is a set of .NET extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style test and which tries to keep you out of the debugger hell.

FluentAssertions: ShouldBeEquivalentTo vs Should().Be() vs Should().BeEquivalentTo()?

Can anybody summarize differences and usage scope between them? I read SO articles, ShouldBeEquivalientTo(): ShouldBeEquivalentTo() is intended to be used …

c# comparison fluent-assertions
How to use Fluent Assertions to test for exception in inequality tests?

I'm trying to write a unit test for a greater than overridden operator using Fluent Assertions in C#. The greater …

c# unit-testing lambda nunit fluent-assertions
How to use Exclude in FluentAssertions for property in collection?

I have two classes: public class ClassA { public int? ID {get; set;} public IEnumerable<ClassB> Children {get; set;} } …

c# unit-testing fluent-assertions
How to compare two Json objects using C#

I have two Json objects as below need to be compared. I am using Newtonsoft libraries for Json parsing. string …

c# unit-testing json.net assertion fluent-assertions
Testing for exceptions in async methods

I'm a bit stuck with this code (this is a sample): public async Task Fail() { await Task.Run(() => { throw …

c# async-await nunit fluent-assertions
How to compare lists using fluent-assertions?

I want to compare a list of objects, ignoring the order of the objects in the list and only comparing …

c# unit-testing xunit fluent-assertions
How to assert all items in a collection using fluent-assertions?

Say I want to test a method returning a bunch of items of the following type using fluent-assertions to ensure …

c# unit-testing collections fluent-assertions
FluentAssertions: equivalence of sorted lists

I'm trying to establish equivalence of two lists using FluentAssertions in C#, where two things are of importance: the elements …

c# unit-testing nunit fluent-assertions
FluentAssertions ShouldNotThrow is not recognised for an async method/Func

I am trying to check an async method throws concrete exception. For that I am using MSTEST and FluentAssertions 2.0.1. I …

c# async-await fluent-assertions
How to assert that all selected properties are set (not null or empty)

I want to verify (assert) that certain properties on my DTO object are set. I was trying to do it …

c# .net fluent-assertions