Class ProtoAssertion
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
expectationstringThe expectation in its positive form, such as "be visible".
negatedboolWhether the assertion asks for the opposite of the check.
Returns
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
holdsboolWhether the underlying check currently holds.
negatedboolWhether the assertion asks for the opposite of the check.