Пример #1
0
        public async System.Threading.Tasks.Task Test_LoginUser_InvalidEmail()
        {
            UserInComingDto newUser = new UserInComingDto()
            {
                Email    = "*****@*****.**",
                Name     = this.mockName,
                Password = this.mockPassword
            };

            AuthenticationService authenticationService = new AuthenticationService(_mapper, _unitOfWorkMock.Object, _loggerFactory.CreateLogger <IAuthenticationService>(), _tokenHandler.Object);

            Assert.Throws <InvalidInputException>(() => authenticationService.AuthenicateUser(newUser));
        }
Пример #2
0
        public async System.Threading.Tasks.Task Test_LoginUser(string email)
        {
            UserInComingDto newUser = new UserInComingDto()
            {
                Email    = email,
                Name     = this.mockName,
                Password = this.mockPassword
            };

            AuthenticationService authenticationService = new AuthenticationService(_mapper, _unitOfWorkMock.Object, _loggerFactory.CreateLogger <IAuthenticationService>(), _tokenHandler.Object);
            TokenDto result = authenticationService.AuthenicateUser(newUser);

            Assert.NotNull(result);
            Assert.NotNull(result.Token);
        }