Esempio n. 1
0
        public void ValidateObject_IValidatableObject_Success()
        {
            var instance = new ValidatableSuccess();
            var context  = new ValidationContext(instance);

            Validator.ValidateObject(instance, context);
        }
Esempio n. 2
0
        public void TryValidateObject_IValidatableObject_Success()
        {
            var instance = new ValidatableSuccess();
            var context  = new ValidationContext(instance);

            var results = new List <ValidationResult>();

            Assert.True(Validator.TryValidateObject(instance, context, results));
            Assert.Empty(results);
        }