public void Should_re_throw_exception_when_booking_client_error() { var serverErrorException = new BookingsApiException("msg", 500, "resp", null, null); _bookingsApiClient.Setup(x => x.GetParticipantsByUsernameAsync("someuser")).ThrowsAsync(serverErrorException); // the exception is rethrown Assert.ThrowsAsync <BookingsApiException>(async() => await _participantService.GetParticipantsByUsernameAsync("someuser")); }