Skip to content

zharkovstas/That

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

That

That is a minimalistic assertion library for .NET.

Usage

Simple assertions

Assert.That(actual1); // a boolean

Assert.That(false); // throws an AssertionException

Assert.That(actual2 is not null);

Assert.That(actual3 == "expected");

Exceptions

var exception = Assert.Throws<InvalidOperationException>(() => podBayDoors.Open());

Assert.That(exception.Message == "I'm sorry Dave");

Descriptive fail messages

Assert.That(actual is null, $"actual; Expected: null; But was: {actual}");

That.Analyzers provides a code-fix to auto-generate these messages based on the expression passed as the first argument to Assert.That.