public void CheckPasswordCorrect() { //Arrange var userService = new UserSevice(); var testPassword = "******"; // Act (string password, string salt) = userService.GeneratePasswordHash(testPassword); // Asset Assert.IsTrue(userService.CheckPassword(testPassword, salt, password)); }
public void CheckPasswordWrongSalt() { //Arrange var userService = new UserSevice(); var testPassword = "******"; var wrongSalt = CryptographyService.CreateHexStringFromByteArray(CryptographyService.GenerateSalt()); // Act (string password, string salt) = userService.GeneratePasswordHash(testPassword); // Asset Assert.IsFalse(userService.CheckPassword(testPassword, wrongSalt, password)); }