Beispiel #1
0
        public void ValidateEmptyCollectionAllowedField_ShouldPassIfEmptyCollectIsProvided()
        {
            var obj = new ModelWithRequiredCollection();

            var validation = ModelValidator.ValidateEntity(obj);

            Assert.IsFalse(validation.HasError);
        }
Beispiel #2
0
        public void ValidateEmptyCollectionAllowedField_ShouldNotPassIfNullCollectIsProvided()
        {
            var obj = new ModelWithRequiredCollection();

            obj.List = null;
            var validation = ModelValidator.ValidateEntity(obj);

            Assert.IsTrue(validation.HasError);
        }