public void AnswerModelValidator_When_AnswerTextIsEmpty_Should_HaveError() { // Arrange // Act AnswerModelValidator answerModelValidator = new AnswerModelValidator(); // Assert answerModelValidator.ShouldHaveValidationErrorFor(x => x.AnswerText, "" as string); }
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); }
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); }
public void AnswerModelValidator_When_AnswerTextIsTooShort_Should_HaveError() { // Arrange var tooShortString = stringOfLength(0); // Act AnswerModelValidator answerModelValidator = new AnswerModelValidator(); // Assert answerModelValidator.ShouldHaveValidationErrorFor(x => x.AnswerText, tooShortString); }