示例#1
0
        public void AnswerModelValidator_When_AnswerTextIsEmpty_Should_HaveError()
        {
            // Arrange

            // Act
            AnswerModelValidator answerModelValidator = new AnswerModelValidator();

            // Assert
            answerModelValidator.ShouldHaveValidationErrorFor(x => x.AnswerText, "" as string);
        }
示例#2
0
        public void AnswerModelValidator_When_IsCorrectIsNotNull_Should_NotHaveError()
        {
            // Arrange
            bool valueOfTruth = (randomBetween(0, 1) == 1);

            // Act
            AnswerModelValidator answerModelValidator = new AnswerModelValidator();

            // Assert
            answerModelValidator.ShouldNotHaveValidationErrorFor(x => x.IsCorrect, valueOfTruth);
        }
示例#3
0
        public void AnswerModelValidator_When_AnswerTextPerfect_Should_NotHaveError()
        {
            // Arrange
            var answerText = stringOfLength(randomBetween(1, 50));

            // Act
            AnswerModelValidator answerModelValidator = new AnswerModelValidator();

            // Assert
            answerModelValidator.ShouldNotHaveValidationErrorFor(x => x.AnswerText, answerText);
        }
示例#4
0
        public void AnswerModelValidator_When_AnswerTextIsTooShort_Should_HaveError()
        {
            // Arrange
            var tooShortString = stringOfLength(0);

            // Act
            AnswerModelValidator answerModelValidator = new AnswerModelValidator();

            // Assert
            answerModelValidator.ShouldHaveValidationErrorFor(x => x.AnswerText, tooShortString);
        }