public void ValidRequiredSeverity() { var info = InfoCreator.CreateValidInfo(); var severityValidator = new SeverityRequiredValidator(info); Assert.True(severityValidator.IsValid); Assert.Equal(0, severityValidator.Errors.Count()); }
public void ValidRequiredCategories() { var info = InfoCreator.CreateValidInfo(); var categoriesValidator = new CategoryRequiredValidator(info); Assert.True(categoriesValidator.IsValid); Assert.Equal(0, categoriesValidator.Errors.Count()); }
public void ValidRequiredCertainty() { var info = InfoCreator.CreateValidInfo(); var certaintyValidator = new CertaintyRequiredValidator(info); Assert.True(certaintyValidator.IsValid); Assert.Equal(0, certaintyValidator.Errors.Count()); }
public void ValidRequiredEvent() { var info = InfoCreator.CreateValidInfo(); var eventValidator = new EventRequiredValidator(info); Assert.True(eventValidator.IsValid); Assert.Equal(0, eventValidator.Errors.Count()); }
public void ValidRequiredUrgency() { var info = InfoCreator.CreateValidInfo(); var urgencyValidator = new UrgencyRequiredValidator(info); Assert.True(urgencyValidator.IsValid); Assert.Equal(0, urgencyValidator.Errors.Count()); }
public void CategoryWithValidValueFromTheCategoryEnumIsValid() { var info = InfoCreator.CreateValidInfo(); var categoryValidator = new InvalidCategoryValidator(info); Assert.True(categoryValidator.IsValid); Assert.Equal(0, categoryValidator.Errors.Count()); }
public void CategoryWithInvalidValueFromTheCategoryEnumIsInvalid() { var info = InfoCreator.CreateInvalidCategory(); var categoryValidator = new InvalidCategoryValidator(info); Assert.False(categoryValidator.IsValid); Assert.Equal(1, categoryValidator.Errors.Count()); }
public void OneInfoWithAllRequiredElementsIsValid() { var alert = new Alert(); var info = InfoCreator.CreateValidInfo(); // one info in alert alert.Info.Add(info); var singleAlertValidator = new InfoValidator(alert); var singleErrorsValidation = singleAlertValidator.Errors; // the info should be valid Assert.True(singleAlertValidator.IsValid); Assert.Equal(0, singleErrorsValidation.Count()); }
public void TwoInfosInAnAlertWithAllRequiredElementsAreValid() { var alert = new Alert(); var info = InfoCreator.CreateValidInfo(); // two infos in alert alert.Info.Add(info); alert.Info.Add(info); var doubleAlertValidator = new InfoValidator(alert); // the info should be valid Assert.True(doubleAlertValidator.IsValid); Assert.Equal(0, doubleAlertValidator.Errors.Count()); }