public void min_required_password_length_should_return_true_for_valid_length() { // Arrange string password = "******"; string username = "******"; int requiredPasswordLength = 7; // Act var rule = new MinRequiredPasswordLength(username, password.Length, requiredPasswordLength); bool actual = rule.Validate(); // Assert Assert.AreEqual(true, actual); }
public void min_required_password_length_succeeds_with_zero_min_password_length() { // Arrange string password = "******"; string username = "******"; int requiredPasswordLength = 0; // Act var rule = new MinRequiredPasswordLength(username, password.Length, requiredPasswordLength); bool actual = rule.Validate(); // Assert Assert.IsTrue(actual); }
public void min_required_password_length_message_succeeds() { // Arrange string password = "******"; string username = "******"; int requiredPasswordLength = 7; // Act var rule = new MinRequiredPasswordLength(username, password.Length, requiredPasswordLength); bool actual = rule.Validate(); // Assert Assert.AreEqual(string.Format("The password for 'joeuser' is less than the required 7 character length.", requiredPasswordLength), rule.ErrorMessage); }