public void ShouldHaveErrorsWhenPasswordComplexityNotSatisfied(string password) { // Arrange. var viewModel = new PasswordResetViewModel { Password = password, ConfirmPassword = password }; var validator = new PasswordResetViewModelClientValidator(); // Act. validator.Validate(viewModel); // Assert. validator.ShouldHaveValidationErrorFor(x => x.Password, viewModel); }
public void ShouldHaveErrorWhenInvalidPasswordResetCodeIsSpecified(string passwordResetCode) { // Arrange. var viewModel = new PasswordResetViewModel { PasswordResetCode = passwordResetCode }; var validator = new PasswordResetViewModelClientValidator(); // Act. validator.Validate(viewModel); // Assert. validator.ShouldHaveValidationErrorFor(x => x.PasswordResetCode, viewModel); }