Пример #1
0
 /// <summary>
 /// Expects the Action to throw any kind of exception
 /// </summary>
 /// <param name="src">Action to run</param>
 /// <param name="customMessage">Custom message to add to failure messages</param>
 /// <returns>Continuation which can be used to test exception messages</returns>
 public static IThrowContinuation <Exception> Throw(
     this ICanAddMatcher <Action> src,
     string customMessage
     )
 {
     return(src.Throw(() => customMessage));
 }
Пример #2
0
 /// <summary>
 /// Expects the action to throw an exception of type T
 /// </summary>
 /// <param name="src">Action to test</param>
 /// <param name="customMessage">Custom message to add to failure messages</param>
 /// <typeparam name="T">Type of exception which is expected</typeparam>
 /// <returns>Continuation which can be used to test exception messages</returns>
 public static IThrowContinuation <T> Throw <T>(
     this ICanAddMatcher <Action> src,
     string customMessage
     ) where T : Exception
 {
     return(src.Throw <T>(() => customMessage));
 }
Пример #3
0
 /// <summary>
 /// Expects the Action to throw any kind of exception
 /// </summary>
 /// <param name="src">Action to run</param>
 /// <returns>Continuation which can be used to test exception messages</returns>
 public static IThrowContinuation <Exception> Throw(
     this ICanAddMatcher <Action> src
     )
 {
     return(src.Throw(NULL_STRING));
 }
Пример #4
0
 /// <summary>
 /// Expects the action to throw an exception of type T
 /// </summary>
 /// <param name="src">Action to test</param>
 /// <typeparam name="T">Type of exception which is expected</typeparam>
 /// <returns>Continuation which can be used to test exception messages</returns>
 public static IThrowContinuation <T> Throw <T>(
     this ICanAddMatcher <Action> src
     ) where T : Exception
 {
     return(src.Throw <T>(NULL_STRING));
 }