Class Assume
Provides static methods to express the assumptions that must be met for a test to give a meaningful result. If an assumption is not met, the test should produce an inconclusive result.
public class Assume
- Inheritance
-
Assume
- Inherited Members
Constructors
Assume()
public Assume()
Methods
ReferenceEquals(object, object)
override the default ReferenceEquals to throw an AssertionException. This implementation makes sure there is no mistake in calling this function as part of Assert.
public static void ReferenceEquals(object a, object b)
Parameters
That(TestDelegate, IResolveConstraint)
Asserts that the code represented by a delegate throws an exception that satisfies the constraint provided.
public static void That(TestDelegate code, IResolveConstraint constraint)
Parameters
codeTestDelegateA TestDelegate to be executed
constraintIResolveConstraintA ThrowsConstraint used in the test
That(bool)
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(bool condition)
Parameters
conditionboolThe evaluated condition
That(bool, string)
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(bool condition, string message)
Parameters
conditionboolThe evaluated condition
messagestringThe message to display if the condition is false
That(bool, string, params object[])
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(bool condition, string message, params object[] args)
Parameters
conditionboolThe evaluated condition
messagestringThe message to display if the condition is false
argsobject[]Arguments to be used in formatting the message
That(Func<bool>)
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(Func<bool> condition)
Parameters
That(Func<bool>, string)
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(Func<bool> condition, string message)
Parameters
conditionFunc<bool>A lambda that returns a Boolean
messagestringThe message to display if the condition is false
That(Func<bool>, string, params object[])
Asserts that a condition is true. If the condition is false the method throws an InconclusiveException.
public static void That(Func<bool> condition, string message, params object[] args)
Parameters
conditionFunc<bool>A lambda that returns a Boolean
messagestringThe message to display if the condition is false
argsobject[]Arguments to be used in formatting the message
That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint)
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr)
Parameters
delActualValueDelegate<TActual>An ActualValueDelegate returning the value to be tested
exprIResolveConstraintA Constraint expression to be applied
Type Parameters
TActual
That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint, string)
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, string message)
Parameters
delActualValueDelegate<TActual>An ActualValueDelegate returning the value to be tested
exprIResolveConstraintA Constraint expression to be applied
messagestringThe message that will be displayed on failure
Type Parameters
TActual
That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint, string, params object[])
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, string message, params object[] args)
Parameters
delActualValueDelegate<TActual>An ActualValueDelegate returning the value to be tested
exprIResolveConstraintA Constraint expression to be applied
messagestringThe message that will be displayed on failure
argsobject[]Arguments to be used in formatting the message
Type Parameters
TActual
That<TActual>(TActual, IResolveConstraint)
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(TActual actual, IResolveConstraint expression)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint to be applied
Type Parameters
TActual
That<TActual>(TActual, IResolveConstraint, string)
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(TActual actual, IResolveConstraint expression, string message)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint to be applied
messagestringThe message that will be displayed on failure
Type Parameters
TActual
That<TActual>(TActual, IResolveConstraint, string, params object[])
Apply a constraint to an actual value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(TActual actual, IResolveConstraint expression, string message, params object[] args)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint expression to be applied
messagestringThe message that will be displayed on failure
argsobject[]Arguments to be used in formatting the message
Type Parameters
TActual
That<TActual>(ref TActual, IResolveConstraint)
Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ref TActual actual, IResolveConstraint expression)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint to be applied
Type Parameters
TActual
That<TActual>(ref TActual, IResolveConstraint, string)
Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ref TActual actual, IResolveConstraint expression, string message)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint to be applied
messagestringThe message that will be displayed on failure
Type Parameters
TActual
That<TActual>(ref TActual, IResolveConstraint, string, params object[])
Apply a constraint to a referenced value, succeeding if the constraint is satisfied and throwing an InconclusiveException on failure.
public static void That<TActual>(ref TActual actual, IResolveConstraint expression, string message, params object[] args)
Parameters
actualTActualThe actual value to test
expressionIResolveConstraintA Constraint to be applied
messagestringThe message that will be displayed on failure
argsobject[]Arguments to be used in formatting the message
Type Parameters
TActual