Example #1
0
 /// <summary>
 /// Show a message if the specified values do not compare in the specified way.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="a">The first value to compare.</param>
 /// <param name="operation">The <see cref="CompareOperation" /> to perform.</param>
 /// <param name="b">The second value to compare.</param>
 /// <param name="message">The message to show.</param>
 /// <param name="args">The arguments to the message to display.</param>
 /// <returns>
 /// True only if the assert condition passed. Otherwise false.
 /// </returns>
 public bool Comparison <T>(T a, CompareOperation operation, T b, string message, params object[] args)
     where T : IComparable
 {
     return(this.Check(
                AssertType.Compare,
                operation.Compare(a, b),
                message,
                args,
                "Compare check failed. [{0} {1} {2}]",
                a,
                operation.GetOperation(),
                b));
 }
Example #2
0
 /// <summary>
 /// Show a message if the specified values do not compare in the specified way.
 /// </summary>
 /// <param name="a">The first value to compare.</param>
 /// <param name="operation">The <see cref="CompareOperation" /> to perform.</param>
 /// <param name="b">The second value to compare.</param>
 /// <param name="precision">The acceptable difference when comparing the floating point value.</param>
 /// <param name="message">The message to show.</param>
 /// <param name="args">The arguments to the message to display.</param>
 /// <returns>
 /// True only if the assert condition passed. Otherwise false.
 /// </returns>
 public bool Comparison(
     double a,
     CompareOperation operation,
     double b,
     double precision,
     string message,
     params object[] args)
 {
     return(this.Check(
                AssertType.Compare,
                operation.Compare(a, b, precision),
                message,
                args,
                "Compare check failed. [{0} {1} {2}]",
                a,
                operation.GetOperation(),
                b));
 }