예제 #1
0
        public async Task RegisterAsync_WhenCreatedSuccessfully_ShouldReturnSuccessResponse()
        {
            var request = new RegistrationRequest()
            {
                Email     = "email",
                FirstName = "first name",
                LastName  = "last name",
                Password  = "******",
                Username  = "******"
            };

            _mockUserManger.Setup(e => e.CreateAsync(It.IsAny <User>(), request.Password))
            .ReturnsAsync(IdentityResult.Success);
            mockEmailHelperService.Setup(e => e.SendEmailConfirmationEmail(It.IsAny <EmailSendRequest>()))
            .ReturnsAsync(ApiResponse.Success());

            var response = await sut.RegisterAsync(request);

            response.IsSuccess.Should().BeTrue();
            response.StatusCode.Should().Be(200);
        }