public void CheckForInvalidQuestion_ShouldNotThrowExceptionForValidQuestionId(string questionId) { // Arrange var element = new ElementBuilder() .WithQuestionId(questionId) .WithType(EElementType.Textarea) .Build(); var check = new InvalidQuestionCheck(); // Act var result = check.Validate(element); // Assert Assert.False(result.IsValid); }
public void InvalidQuestion_IsNotValid_WhenQuestionIdInvalid(string questionId) { // Arrange var element = new ElementBuilder() .WithQuestionId(questionId) .WithType(EElementType.Textarea) .Build(); var check = new InvalidQuestionCheck(); // Act var result = check.Validate(element); // Assert Assert.False(result.IsValid); Assert.Collection <string>(result.Messages, message => Assert.StartsWith(IntegrityChecksConstants.FAILURE, message)); }
public void QuestionIsValid_WhenQuestionIdValid(string questionId) { // Arrange var validElement = new ElementBuilder() .WithQuestionId(questionId) .WithType(EElementType.Textarea) .Build(); var check = new InvalidQuestionCheck(); // Act var result = check.Validate(validElement); // Assert Assert.True(result.IsValid); Assert.DoesNotContain(IntegrityChecksConstants.FAILURE, result.Messages); }