Back to Nunit

ThrowsNothing Constraint

docs/articles/nunit/writing-tests/constraints/ThrowsNothingConstraint.md

latest318 B
Original Source

ThrowsNothing Constraint

ThrowsNothingConstraint asserts that the delegate passed as its argument does not throw an exception.

Constructor

csharp
ThrowsNothingConstraint()

Syntax

csharp
Throws.Nothing

Example of Use

csharp
Assert.That(() => SomeMethod(actual), Throws.Nothing);