public async Task ShouldRequirePasswordConfirmationMatchesNewPassword() { var currentPassword = SamplePassword(); await LogIn(currentPassword); var command = new ChangePassword.Command { CurrentPassword = currentPassword }; command.NewPassword = null; command.ConfirmPassword = "******"; command.ShouldNotValidate("'New Password' must not be empty."); command.NewPassword = "******"; command.ConfirmPassword = null; command.ShouldNotValidate("'Confirm Password' must not be empty."); command.NewPassword = "******"; command.ConfirmPassword = "******"; command.ShouldValidate(); command.NewPassword = "******"; command.ConfirmPassword = "******"; command.ShouldNotValidate("These passwords do not match. Be sure to enter the same password twice."); }
public async Task ShouldRequireValidCurrentPasswordToAuthorizePasswordChange() { var currentPassword = SamplePassword(); await LogIn(currentPassword); var typeo = new ChangePassword.Command { CurrentPassword = "******", NewPassword = "******", ConfirmPassword = "******" }; var valid = new ChangePassword.Command { CurrentPassword = currentPassword, NewPassword = "******", ConfirmPassword = "******" }; typeo.ShouldNotValidate("'Current Password' was invalid. Please enter your current password and try again."); valid.ShouldValidate(); }