public void ChangePassword_WithNotMatchingNewPasswords_ThrowsPasswordsMismatchException() { string newPassword = "******"; string confirmPassword = "******"; PasswordsMismatchException exception = Assert.ThrowsAsync <PasswordsMismatchException>( () => _authenticationService.ChangePassword(It.IsAny <User>(), It.IsAny <string>(), newPassword, confirmPassword)); string actualPassword = exception.Password; string actualConfirmPassword = exception.ConfirmPassword; Assert.AreEqual(newPassword, actualPassword); Assert.AreEqual(confirmPassword, actualConfirmPassword); }
public void Register_WithPasswordsNotMatching_ThrowsPasswordsMismatchException() { string password = "******"; string confirmPassword = "******"; PasswordsMismatchException exception = Assert.ThrowsAsync <PasswordsMismatchException>( () => _authenticationService.Register(It.IsAny <string>(), It.IsAny <string>(), password, confirmPassword, It.IsAny <string>(), It.IsAny <string>())); string actualPassword = exception.Password; string actualConfirmPassword = exception.ConfirmPassword; Assert.AreEqual(password, actualPassword); Assert.AreEqual(confirmPassword, actualConfirmPassword); }