Skip to content

Assertions

Wesley Baartman edited this page Jun 24, 2018 · 12 revisions

Home > Assertions

Subcategories

Introduction

This page describes how you can write assertions using AssertNET.

Chaining

It is good to know that most AssertNET conditions can be chained. This means you can for example write assertions like this:

AssertThat(4)
	.IsLesserThan(10)
	.IsGreaterThan(0)
	.IsInRange(0, 10);

This is also true for the AssertNet.Moq package:

AssertThat(someMock)
	.HasInvoked(x => x.Stub1()).Once()
	.HasInvoked(x => x.Stub2()).Never();