/// <summary> /// Used to test exception messages in the negative /// </summary> /// <param name="continuation">Continuation containing exception message to test</param> /// <param name="test">Custom function to test the message -- return true if the test should pass</param> /// <returns>Another continuation so you can do .And()</returns> public static IStringPropertyContinuation Matching( this IPropertyNot <string> continuation, Func <string, bool> test ) { return(continuation.Matching(test, NULL_STRING)); }
/// <summary> /// Used to test exception messages in the negative /// </summary> /// <param name="continuation">Continuation containing exception message to test</param> /// <param name="test">Custom function to test the message -- return true if the test should pass</param> /// <param name="customMessage">Custom message to add to failure messages</param> /// <returns>Another continuation so you can do .And()</returns> public static IStringPropertyContinuation Matching( this IPropertyNot <string> continuation, Func <string, bool> test, string customMessage ) { return(continuation.Matching(test, () => customMessage)); }
/// <summary> /// Used to test exception messages in the negative /// </summary> /// <param name="continuation">Continuation containing exception message to test</param> /// <param name="test">Custom function to test the message -- return true if the test should pass</param> /// <param name="customMessageGenerator">Generates a custom message to add to failure messages</param> /// <returns>Another continuation so you can do .And()</returns> public static IStringPropertyContinuation Matching( this IPropertyNot <string> continuation, Func <string, bool> test, Func <string> customMessageGenerator ) { continuation.AddMatcher( s => { var passed = !test(s); return(new MatcherResult( passed, MessageForNotMatchResult( passed, s, customMessageGenerator ) )); }); return(continuation.More()); }
/// <summary> /// /// </summary> /// <param name="continuation"></param> /// <returns></returns> public static IStringPropertyContinuation More( this IPropertyNot <string> continuation ) { return((continuation as IExpectationContext <string>).More()); }