Beispiel #1
0
 /// <summary>
 /// Apply a constraint to a referenced value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expression">A Constraint expression to be applied</param>
 /// <param name="actual">The actual value to test</param>
 static public void That <T>(ref T actual, IResolveConstraint expression)
 {
     Assume.That(ref actual, expression.Resolve(), null, null);
 }
Beispiel #2
0
 /// <summary>
 /// Apply a constraint to a referenced value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expression">A Constraint expression to be applied</param>
 /// <param name="actual">The actual value to test</param>
 /// <param name="message">The message that will be displayed on failure</param>
 static public void That <T>(ref T actual, IResolveConstraint expression, string message)
 {
     Assume.That(ref actual, expression.Resolve(), message, null);
 }
Beispiel #3
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the
 /// method throws an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">The evaluated condition</param>
 static public void That(bool condition)
 {
     Assume.That(condition, Is.True, null, null);
 }
Beispiel #4
0
 /// <summary>
 /// Asserts that the code represented by a delegate throws an exception
 /// that satisfies the constraint provided.
 /// </summary>
 /// <param name="code">A TestDelegate to be executed</param>
 /// <param name="constraint">A ThrowsConstraint used in the test</param>
 static public void That(TestDelegate code, IResolveConstraint constraint)
 {
     Assume.That((object)code, constraint);
 }
Beispiel #5
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">The evaluated condition</param>
 /// <param name="message">The message to display if the condition is false</param>
 /// <param name="args">Arguments to be used in formatting the message</param>
 static public void That(bool condition, string message, params object[] args)
 {
     Assume.That(condition, Is.True, message, args);
 }
Beispiel #6
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">The evaluated condition</param>
 /// <param name="message">The message to display if the condition is false</param>
 static public void That(bool condition, string message)
 {
     Assume.That(condition, Is.True, message, null);
 }
Beispiel #7
0
 /// <summary>
 /// Apply a constraint to an actual value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expr">A Constraint expression to be applied</param>
 /// <param name="del">An ActualValueDelegate returning the value to be tested</param>
 static public void That(ActualValueDelegate del, IResolveConstraint expr)
 {
     Assume.That(del, expr.Resolve(), null, null);
 }
Beispiel #8
0
 /// <summary>
 /// Apply a constraint to a referenced value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="constraint">A Constraint to be applied</param>
 /// <param name="actual">The actual value to test</param>
 /// <param name="message">The message that will be displayed on failure</param>
 static public void That(ref bool actual, IResolveConstraint constraint, string message)
 {
     Assume.That(ref actual, constraint.Resolve(), message, null);
 }
Beispiel #9
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">A lambda that returns a Boolean</param>
 /// <param name="getExceptionMessage">A function to build the message included with the Exception</param>
 public static void That(Func <bool> condition, Func <string> getExceptionMessage)
 {
     Assume.That(condition.Invoke(), Is.True, getExceptionMessage);
 }
Beispiel #10
0
 /// <summary>
 /// Apply a constraint to an actual value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <typeparam name="TActual">The Type being compared.</typeparam>
 /// <param name="actual">The actual value to test</param>
 /// <param name="expression">A Constraint expression to be applied</param>
 public static void That <TActual>(TActual actual, IResolveConstraint expression)
 {
     Assume.That(actual, expression, null, null);
 }
Beispiel #11
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">A lambda that returns a Boolean</param>
 public static void That(Func <bool> condition)
 {
     Assume.That(condition.Invoke(), Is.True, null, null);
 }
Beispiel #12
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">A lambda that returns a Boolean</param>
 /// <param name="message">The message to display if the condition is false</param>
 /// <param name="args">Arguments to be used in formatting the message</param>
 public static void That(Func <bool> condition, string message, params object[] args)
 {
     Assume.That(condition.Invoke(), Is.True, message, args);
 }
Beispiel #13
0
 /// <summary>
 /// Asserts that a condition is true. If the condition is false the method throws
 /// an <see cref="InconclusiveException"/>.
 /// </summary>
 /// <param name="condition">The evaluated condition</param>
 /// <param name="getExceptionMessage">A function to build the message included with the Exception</param>
 public static void That(bool condition, Func <string> getExceptionMessage)
 {
     Assume.That(condition, Is.True, getExceptionMessage);
 }
Beispiel #14
0
 /// <summary>
 /// Apply a constraint to an actual value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expression">A Constraint expression to be applied</param>
 /// <param name="actual">The actual value to test</param>
 static public void That(object actual, IResolveConstraint expression)
 {
     Assume.That(actual, expression, null, null);
 }
Beispiel #15
0
 /// <summary>
 /// Apply a constraint to an actual value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expr">A Constraint expression to be applied</param>
 /// <param name="del">An ActualValueDelegate returning the value to be tested</param>
 /// <param name="message">The message that will be displayed on failure</param>
 static public void That(ActualValueDelegate del, IResolveConstraint expr, string message)
 {
     Assume.That(del, expr.Resolve(), message, null);
 }
Beispiel #16
0
 /// <summary>
 /// Apply a constraint to an actual value, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="expression">A Constraint expression to be applied</param>
 /// <param name="actual">The actual value to test</param>
 /// <param name="message">The message that will be displayed on failure</param>
 static public void That(object actual, IResolveConstraint expression, string message)
 {
     Assume.That(actual, expression, message, null);
 }
Beispiel #17
0
 /// <summary>
 /// Apply a constraint to a referenced boolean, succeeding if the constraint
 /// is satisfied and throwing an InconclusiveException on failure.
 /// </summary>
 /// <param name="constraint">A Constraint to be applied</param>
 /// <param name="actual">The actual value to test</param>
 static public void That(ref bool actual, IResolveConstraint constraint)
 {
     Assume.That(ref actual, constraint.Resolve(), null, null);
 }