Validate() public méthode

public Validate ( ) : bool
Résultat bool
Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }