Open sandboxFocus

Method Assert

Assert(bool, string?)

Checks that a given condition is true and throws an AssertionFailedException in case it is not.

Declaration
public static void Assert(bool condition, string? expression = null)
Parameters
Type Name Description
bool condition

The condition that must be true.

string expression

Assert<T>(T, Predicate<T>)

Declaration
public static T Assert<T>(this T obj, Predicate<T> predicate) where T : class
Parameters
Type Name Description
T obj
Predicate<T> predicate
Returns
Type Description
T
Type Parameters
Name Description
T