IT:AD:XUnit:HowTo:Use Fluent Assertions
Summary
IT:AD:NUnit had fluent assertions out of the box. IT:AD:XUnit doesn't.
Process
For that, consider using an additional – well-respected – library: IT:AD:FluentAssertions.
The library works equally well with IT:AD:NUnit as IT:AD:XUnit as well other frameworks – so it makes your tests portable (bar the Test/Fact attributes which have to be updated).
The library uses a Should() method followed by one of a set of Be...() methods, which makes your tests very readable:
var foo = false; foo.Should().BeTrue(); var bar = 3; foo.Should().Be(3); foo.Should().BeGreaterThan(2); foo.Should().BeLessThan(4); foo.Should().NotBe(5);