示例#1
0
 /// <summary>
 /// Tests whether the Actual string is matched by the given Regex
 /// </summary>
 /// <param name="matched">Continuation to operate on</param>
 /// <param name="regex">Regex string to match with</param>
 /// <returns>More continuation for Actual string</returns>
 public static IStringMore Match(
     this ITo <string> matched,
     string regex
     )
 {
     return(matched.Match(regex, NULL_STRING));
 }
 /// <summary>
 /// Match the value under test with a simple Func which takes in your value
 /// and returns true if the test should pass.
 /// </summary>
 /// <param name="continuation">Continuation to act on</param>
 /// <param name="test">Func to test the original value with</param>
 /// <typeparam name="T"></typeparam>
 public static void Match <T>(
     this ITo <T> continuation,
     Func <T, bool> test
     )
 {
     continuation.Match(test, NULL_STRING);
 }
 public static void Match <T>(
     this ITo <T> continuation,
     Func <T, bool> test
     )
 {
     continuation.Match(test, null);
 }
示例#4
0
 /// <summary>
 /// Tests whether the Actual string is matched by the given Regex
 /// </summary>
 /// <param name="matched">Continuation to operate on</param>
 /// <param name="regex">Regex string to match with</param>
 /// <param name="customMessage">Custom message to add to failure messages</param>
 /// <returns>More continuation for Actual string</returns>
 public static IStringMore Match(
     this ITo <string> matched,
     string regex,
     string customMessage
     )
 {
     return(matched.Match(regex, () => customMessage));
 }
 /// <summary>
 /// Match the value under test with a simple Func which takes in your value
 /// and returns true if the test should pass.
 /// </summary>
 /// <param name="continuation">Continuation to act on</param>
 /// <param name="test">Func to test the original value with</param>
 /// <param name="customMessage">Message to include in the result upon failure</param>
 /// <typeparam name="T"></typeparam>
 public static void Match <T>(
     this ITo <T> continuation,
     Func <T, bool> test,
     string customMessage
     )
 {
     continuation.Match(test, () => customMessage);
 }