コード例 #1
0
 /// <summary>
 /// Performs reference equality checking between your actual and the provided expected value
 /// </summary>
 /// <param name="be">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="customMessage"></param>
 /// <typeparam name="T">Type of the object being tested</typeparam>
 public static void Be <T>(
     this ICollectionTo <T> be,
     object expected,
     string customMessage)
 {
     be.Be(expected, () => customMessage);
 }
コード例 #2
0
 /// <summary>
 /// Performs reference equality checking between your actual and the provided expected value
 /// </summary>
 /// <param name="be">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <param name="customMessageGenerator"></param>
 /// <typeparam name="T">Type of the object being tested</typeparam>
 public static void Be <T>(
     this ICollectionTo <T> be,
     object expected,
     Func <string> customMessageGenerator)
 {
     be.AddMatcher(CreateCollectionRefEqualMatcherFor <T>(expected, customMessageGenerator));
 }
コード例 #3
0
 /// <summary>
 /// Short contain, equivalent to .Contain.At.Least.One.Equal.To(x)
 /// -> less expressive, but shorter to type (:
 /// </summary>
 /// <param name="continuation"></param>
 /// <param name="search"></param>
 /// <typeparam name="T"></typeparam>
 public static void Contain <T>(
     this ICollectionTo <T> continuation,
     T search)
 {
     continuation.AddMatcher(collection =>
     {
         var passed  = collection.Contains(search);
         var notPart = passed ? "" : "not ";
         return(new MatcherResult(
                    passed,
                    $"Expected {collection} {notPart}to contain {search}"
                    ));
     });
 }
コード例 #4
0
 /// <summary>
 /// Performs reference equality checking between your actual and the provided expected value
 /// </summary>
 /// <param name="be">Continuation to operate on</param>
 /// <param name="expected">Expected value</param>
 /// <typeparam name="T">Type of the object being tested</typeparam>
 public static void Be <T>(
     this ICollectionTo <T> be,
     object expected)
 {
     be.Be(expected, NULL_STRING);
 }