Exemple #1
0
        public void PostAcceptInviteAsync_ShouldReturnExpectedHttpStatusCodeOnKnownErrors(Exception exception, int expectedStatusCode)
        {
            _groupService.AcceptInviteAsync(_executionContext, Arg.Any <int>(), Arg.Any <int>())
            .Returns(Task.FromException <GroupInvite>(exception));

            Func <Task> act = () => _controller.PostAcceptInviteAsync(_executionContext, 8, 12);

            act.Should().Throw <HttpErrorException>().Which.StatusCode.Should().Be(expectedStatusCode);
        }