Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }