Exemplo n.º 1
0
    public async Task Should_Not_Handle_Exceptions_For_Void_Return_Values()
    {
        await Assert.ThrowsAsync <UserFriendlyException>(
            async() => await GetResponseAsStringAsync(
                "/ExceptionHandling/ExceptionTestPage?handler=UserFriendlyException_Void"
                )
            );

#pragma warning disable 4014
        _fakeExceptionSubscriber
        .DidNotReceive()
        .HandleAsync(Arg.Any <ExceptionNotificationContext>());
#pragma warning restore 4014
    }
Exemplo n.º 2
0
        public async Task Should_Not_Handle_Exceptions_For_ActionResult_Return_Values()
        {
            await Assert.ThrowsAsync <UserFriendlyException>(
                async() => await GetResponseAsObjectAsync <RemoteServiceErrorResponse>(
                    "/api/exception-test/UserFriendlyException2"
                    )
                );

            _fakeExceptionSubscriber
            .DidNotReceive()
            .HandleAsync(Arg.Any <ExceptionNotificationContext>());
        }
Exemplo n.º 3
0
        public async Task Should_Not_Handle_Exceptions_For_ActionResult_Return_Values()
        {
            await Assert.ThrowsAsync <UserFriendlyException>(
                async() => await GetResponseAsObjectAsync <RemoteServiceErrorResponse>(
                    "/ExceptionHandling/ExceptionTestPage?handler=UserFriendlyException2"
                    )
                );

#pragma warning disable 4014
            _fakeExceptionSubscriber
            .DidNotReceive()
            .HandleAsync(Arg.Any <ExceptionNotificationContext>());
#pragma warning restore 4014
        }