/// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within 1 second
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="customMessage">Custom message to include when
 /// this expectation fails</param>
 /// <returns></returns>
 public static IMore <DateTime> Equal(
     this IApproximately <DateTime> continuation,
     DateTime expected,
     string customMessage)
 {
     return(continuation.Equal(expected, () => customMessage));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Tests if the actual value is approximately equal, using the
 /// provided comparer
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <param name="comparer"></param>
 /// <param name="customMessage"></param>
 /// <returns></returns>
 public static IMore <decimal> Equal(this IApproximately <decimal> approx,
                                     decimal expected,
                                     IEqualityComparer <decimal> comparer,
                                     string customMessage)
 {
     return(approx.Equal(expected, comparer, () => customMessage));
 }
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within the allowed drift timespan
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="allowedDrift">How much the actual value may drift from the expected
 /// value</param>
 /// <returns></returns>
 public static IMore <DateTime> Equal(
     this IApproximately <DateTime> continuation,
     DateTime expected,
     TimeSpan allowedDrift)
 {
     return(continuation.Equal(expected, allowedDrift, NULL_STRING));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Tests if the actual value is approximately equal, to two decimal
 /// places
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <param name="customMessageGenerator"></param>
 /// <returns></returns>
 public static IMore <decimal> Equal(this IApproximately <decimal> approx,
                                     decimal expected,
                                     Func <string> customMessageGenerator)
 {
     return(approx.Equal(expected,
                         new DecimalsEqualToDecimalPlacesRounded(2),
                         customMessageGenerator));
 }
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within 1 second
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="customMessageGenerator">Generates a custom message to include when
 /// this expectation fails</param>
 /// <returns></returns>
 public static IMore <DateTime> Equal(
     this IApproximately <DateTime> continuation,
     DateTime expected,
     Func <string> customMessageGenerator)
 {
     return(continuation.Equal(expected,
                               TimeSpan.FromSeconds(1),
                               customMessageGenerator));
 }
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within the provided allowed drift value
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="allowedDrift">How much the actual value may drift from the expected
 /// value</param>
 /// <param name="customMessageGenerator">Generates a custom message to include when
 /// this expectation fails</param>
 /// <returns></returns>
 public static IMore <DateTime> Equal(
     this IApproximately <DateTime> continuation,
     DateTime expected,
     TimeSpan allowedDrift,
     Func <string> customMessageGenerator)
 {
     return(continuation.Equal(expected,
                               new EqualWithinTimespan(allowedDrift),
                               customMessageGenerator));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within the provided allowed drift value
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="allowedDrift">How much the actual value may drift from the expected
 /// value</param>
 /// <param name="customMessage">Custom message to include when
 /// this expectation fails</param>
 /// <returns></returns>
 public static IMore <DateTime?> Equal(
     this IApproximately <DateTime?> continuation,
     DateTime expected,
     TimeSpan allowedDrift,
     string customMessage)
 {
     return(continuation.Equal(expected,
                               allowedDrift,
                               () => customMessage));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Tests if the actual value is approximately equal, using the
 /// provided comparer
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <param name="comparer"></param>
 /// <returns></returns>
 public static IMore <decimal> Equal(this IApproximately <decimal> approx,
                                     decimal expected,
                                     IEqualityComparer <decimal> comparer)
 {
     return(approx.Equal(expected, comparer, NULL_STRING));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Tests if the actual value is approximately equal, to two decimal
 /// places
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <returns></returns>
 public static IMore <decimal> Equal(this IApproximately <decimal> approx,
                                     decimal expected)
 {
     return(approx.Equal(expected, MessageHelpers.NULL_STRING));
 }
 /// <summary>
 /// Tests if the actual value is approximately equal, using the
 /// provided comparer
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <param name="comparer"></param>
 /// <returns></returns>
 public static IMore <double> Equal(this IApproximately <double> approx,
                                    double expected,
                                    IEqualityComparer <double> comparer)
 {
     return(approx.Equal(expected, comparer, MessageHelpers.NULL_STRING));
 }
 /// <summary>
 /// Tests if the actual value is approximately equal, to two double
 /// places
 /// </summary>
 /// <param name="approx"></param>
 /// <param name="expected"></param>
 /// <param name="customMessage"></param>
 /// <returns></returns>
 public static IMore <double> Equal(this IApproximately <double> approx,
                                    double expected,
                                    string customMessage)
 {
     return(approx.Equal(expected, () => customMessage));
 }
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within 1 second
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <returns></returns>
 public static IMore <DateTime> Equal(
     this IApproximately <DateTime> continuation,
     DateTime expected)
 {
     return(continuation.Equal(expected, NULL_STRING));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Tests if the actual DateTime is approximately equal to the
 /// expected value within 1 second
 /// </summary>
 /// <param name="continuation">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <returns></returns>
 public static IMore <DateTime?> Equal(
     this IApproximately <DateTime?> continuation,
     DateTime expected)
 {
     return(continuation.Equal(expected, MessageHelpers.NULL_STRING));
 }