public void NotValidWhenQuestionScoresIsNull() { // Arrange var model = new BaseScoreCardViewModel { QuestionScores = null }; // Act var isValid = Validator.TryValidateObject(model, new ValidationContext(model), null); // Assert Assert.False(isValid); }
public void NotValidWhenOneQuestionScoreIsUndecided() { // Arrange var model = new BaseScoreCardViewModel { QuestionScores = new List<QuestionScoreViewModel> { new QuestionScoreViewModel { Score = Score.Absent }, new QuestionScoreViewModel { Score = Score.Excellent }, new QuestionScoreViewModel { Score = Score.Undecided }, } }; // Act var isValid = Validator.TryValidateObject(model, new ValidationContext(model), null); // Assert Assert.False(isValid); }