Пример #1
0
        public void ValidateObject_IValidatableObject_Null()
        {
            var instance = new ValidatableNull();
            var context  = new ValidationContext(instance);

            Validator.ValidateObject(instance, context);
        }
Пример #2
0
        public void TryValidateObject_IValidatableObject_Null()
        {
            var instance = new ValidatableNull();
            var context  = new ValidationContext(instance);

            var results = new List <ValidationResult>();

            Assert.True(Validator.TryValidateObject(instance, context, results));
            Assert.Equal(0, results.Count);
        }