/// <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 IStringContainContinuation Matching( this INot <string> continuation, Func <string, bool> test ) { var result = Factory.Create <string, ExceptionMessageContainuationToStringContainContinuation>( null, continuation as IExpectationContext <string> ); continuation.AddMatcher(s => { result.Actual = s; var passed = !test(s); return(new MatcherResult( passed, MessageHelpers.MessageForNotMatchResult( passed, s ) )); }); return(result); }