public void requires_q_and_a_returns_true_if_not_required_and_q_and_a_are_empty() { // Arrange string question = string.Empty; string answer = string.Empty; string username = "******"; bool required = false; // Act var rule = new RequiresQuestionAndAnswer(username, question, answer, required); bool actual = rule.Validate(); // Assert Assert.IsTrue(actual); }
public void requires_q_and_a_succeeds_with_all_valid_values() { // Arrange string question = "Favorite color"; string answer = "Mauve"; string username = "******"; bool required = true; // Act var rule = new RequiresQuestionAndAnswer(username, question, answer, required); bool actual = rule.Validate(); // Assert Assert.IsTrue(actual); }
public void requires_q_and_a_returns_false_with_no_quesion() { // Arrange bool required = true; string question = string.Empty; string answer = "my answer"; string username = "******"; // Act var rule = new RequiresQuestionAndAnswer(username, question, answer, required); bool actual = rule.Validate(); // Assert Assert.IsFalse(actual); }