コード例 #1
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
 /// <summary>
 /// Tests whether the Actual string is matched by the given Regex
 /// </summary>
 /// <param name="matcher">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 INotAfterTo <string> matcher,
     string regex
     )
 {
     return(matcher.Match(regex, NULL_STRING));
 }
コード例 #2
0
 /// <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 INotAfterTo <T> continuation,
     Func <T, bool> test
     )
 {
     continuation.Match(test, NULL_STRING);
 }
コード例 #3
0
ファイル: StringMatchers.cs プロジェクト: tammylotter/NExpect
 /// <summary>
 /// Tests whether the Actual string is matched by the given Regex
 /// </summary>
 /// <param name="matcher">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 INotAfterTo <string> matcher,
     string regex,
     string customMessage
     )
 {
     return(matcher.Match(regex, () => customMessage));
 }
コード例 #4
0
 /// <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 INotAfterTo <T> continuation,
     Func <T, bool> test,
     string customMessage
     )
 {
     continuation.Match(test, () => customMessage);
 }