Search Results for

    Show / Hide Table of Contents

    Assert.CatchAsync

    Assert.CatchAsync is similar to Assert.ThrowsAsync but will pass for an exception that is derived from the one specified.

    Exception Assert.CatchAsync(AsyncTestDelegate code);
    Exception Assert.CatchAsync(AsyncTestDelegate code,
                                string message, params object[] params);
    
    Exception Assert.CatchAsync(Type expectedExceptionType, AsyncTestDelegate code);
    Exception Assert.CatchAsync(Type expectedExceptionType, AsyncTestDelegate code,
                                string message, params object[] params);
    
    T Assert.CatchAsync<T>(AsyncTestDelegate code);
    T Assert.CatchAsync<T>(AsyncTestDelegate code,
                           string message, params object[] params);
    

    See Also

    • Assert.Catch
    • Assert.Throws
    • Assert.ThrowsAsync
    • ThrowsConstraint
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0