Пример #1
0
        public void AreaWithAreaDescriptionIsValid()
        {
            var area = new Area();

            area.Description = "U.S. nationwide and interests worldwide";

            var areaDescriptionRequiredValidator = new AreaDescriptionRequiredValidator(area);

            Assert.True(areaDescriptionRequiredValidator.IsValid);
            Assert.Equal(0, areaDescriptionRequiredValidator.Errors.Count());
        }
Пример #2
0
        public void AreaWithAreaDescriptionEmptyIsInvalid()
        {
            var area = new Area();

            area.Description = string.Empty;

            var areaDescriptionRequiredValidator = new AreaDescriptionRequiredValidator(area);

            Assert.False(areaDescriptionRequiredValidator.IsValid);
            Assert.Equal(1, areaDescriptionRequiredValidator.Errors.Count());
        }