📄️ Awaiting
In TUnit you await your assertions, and this serves two purposes:
📄️ And Conditions
TUnit can chain assertions together, using the And property. This reads very much like English, and aims to keep the test easy to read and understand, and doesn't require you repeat boilerplate code such as Assert.That over and over.
📄️ Assertion Scopes
In TUnit you can create an assertion scope by calling Assert.Multiple(). This returns an IDisposable and so you should use that by encapsulating the returned value in a using block. This will make sure that any assertion exceptionss are aggregated together and thrown only after the scope is exited.
📄️ Or Conditions
Similar to the And property, there is also the Or property.
📄️ Type Checking
TUnit assertions try to check the types at compile time.
📄️ Delegates
TUnit can execute your delegates for you, and this allows you to assert on the data returned (if any was) - Or on any exceptions thrown:
📄️ Assertion Groups
Mixing 'Or' & 'And' conditions within Assert.That(...) statements may result in unexpected logic.
📄️ Congratulations
That's all you need to know about assertions.
📄️ Extensibility / Custom Assertions
The TUnit Assertions can be easily extended so that you can create your own assertions.