Esempio n. 1
0
        public void ValidRequiredSeverity()
        {
            var info = InfoCreator.CreateValidInfo();
            var severityValidator = new SeverityRequiredValidator(info);

            Assert.True(severityValidator.IsValid);
            Assert.Equal(0, severityValidator.Errors.Count());
        }
Esempio n. 2
0
        public void ValidRequiredCategories()
        {
            var info = InfoCreator.CreateValidInfo();
            var categoriesValidator = new CategoryRequiredValidator(info);

            Assert.True(categoriesValidator.IsValid);
            Assert.Equal(0, categoriesValidator.Errors.Count());
        }
Esempio n. 3
0
        public void ValidRequiredCertainty()
        {
            var info = InfoCreator.CreateValidInfo();
            var certaintyValidator = new CertaintyRequiredValidator(info);

            Assert.True(certaintyValidator.IsValid);
            Assert.Equal(0, certaintyValidator.Errors.Count());
        }
Esempio n. 4
0
        public void ValidRequiredEvent()
        {
            var info           = InfoCreator.CreateValidInfo();
            var eventValidator = new EventRequiredValidator(info);

            Assert.True(eventValidator.IsValid);
            Assert.Equal(0, eventValidator.Errors.Count());
        }
Esempio n. 5
0
        public void ValidRequiredUrgency()
        {
            var info             = InfoCreator.CreateValidInfo();
            var urgencyValidator = new UrgencyRequiredValidator(info);

            Assert.True(urgencyValidator.IsValid);
            Assert.Equal(0, urgencyValidator.Errors.Count());
        }
Esempio n. 6
0
        public void CategoryWithValidValueFromTheCategoryEnumIsValid()
        {
            var info = InfoCreator.CreateValidInfo();

            var categoryValidator = new InvalidCategoryValidator(info);

            Assert.True(categoryValidator.IsValid);
            Assert.Equal(0, categoryValidator.Errors.Count());
        }
Esempio n. 7
0
        public void CategoryWithInvalidValueFromTheCategoryEnumIsInvalid()
        {
            var info = InfoCreator.CreateInvalidCategory();

            var categoryValidator = new InvalidCategoryValidator(info);

            Assert.False(categoryValidator.IsValid);
            Assert.Equal(1, categoryValidator.Errors.Count());
        }
Esempio n. 8
0
        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());
        }
Esempio n. 9
0
        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());
        }