Class ProtoAssertion

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Runner-independent semantics shared by integrations whose assertions run in a positive or a negated form. A negated assertion is satisfied when the underlying check does not hold, and its expectation reads with a leading "not".

public static class ProtoAssertion
Inheritance
ProtoAssertion
Inherited Members

Methods

Describe(string, bool)

Describes an expectation the way a reader should see it, prefixing "not " for a negated assertion — for example "be visible" or "not be visible".

public static string Describe(string expectation, bool negated = false)

Parameters

expectation string

The expectation in its positive form, such as "be visible".

negated bool

Whether the assertion asks for the opposite of the check.

Returns

string

IsSatisfied(bool, bool)

Returns whether an assertion is satisfied. A positive assertion is satisfied when holds is true; a negated assertion is satisfied when it is false.

public static bool IsSatisfied(bool holds, bool negated = false)

Parameters

holds bool

Whether the underlying check currently holds.

negated bool

Whether the assertion asks for the opposite of the check.

Returns

bool