public void HashPassword() { var sut = new UserPasswordService(); var hash = sut.HashPassword("123456"); Assert.NotEmpty(hash); }
public void HashPasswordAndTest() { var sut = new UserPasswordService(); var hash = sut.HashPassword("123456"); Assert.NotEmpty(hash); var user = new User { Password = hash }; Assert.True(sut.ComparePassword(user, "123456")); }
public async Task <ApplicationStatus> InitializedApplicationAsync(string Name, string EmailAddress, string PhoneNumber, string Password) { var user = new User() { Name = Name, EmailAddress = EmailAddress, PhoneNumber = PhoneNumber }; var password = new UserPassword() { Password = _userPasswordService.HashPassword(user, Password) }; _ctx.Users.Add(user); _ctx.UserPasswords.Add(password); await _ctx.SaveChangesAsync(); return(await GetApplicationStatusAsync()); }