Beispiel #1
0
        public async Task PostCreateInviteAsync_ShouldCreateInvite_ThenReturnInviteResponse()
        {
            const int groupId             = 8;
            var       createInviteRequest = new CreateInviteRequest();
            var       createdInvite       = new GroupInvite();
            var       groupInviteResponse = new GroupInviteResponse();

            _groupService.CreateInviteAsync(_executionContext, groupId, createInviteRequest)
            .Returns(createdInvite);
            _mapper.Map <GroupInviteResponse>(createdInvite)
            .Returns(groupInviteResponse);

            var result = await _controller.PostCreateInviteAsync(_executionContext, groupId, createInviteRequest);

            result.Value.Should().BeSameAs(groupInviteResponse);
            result.StatusCode.Should().Be(StatusCodes.Status201Created);
        }