public void GetValidationsTest()
        {
            ValidationUnity.RegisterValidation(typeof(Products), new ProductQuantityValidateAttribute());
            var validations = ValidationUnity.GetValidations(typeof(Products));

            Console.WriteLine(validations.Count());
        }
 public void RegisterValidationParallelTest()
 {
     Parallel.For(0, 100, (i) =>
     {
         ValidationUnity.RegisterValidation(typeof(Products), new ProductQuantityValidateAttribute());
     });
 }
        public void GetPropertyValidationsTest()
        {
            var p = PropertyUnity.GetProperty(typeof(Orders), "CustomerID");

            ValidationUnity.RegisterValidation(p, new ProductQuantityValidateAttribute());
            var validations = ValidationUnity.GetValidations(p);

            Console.WriteLine(validations.Count());
        }
        public void ValidateWithCustomAttributeTest()
        {
            ValidationUnity.RegisterValidation(typeof(Products), new ProductQuantityValidateAttribute());
            var p = new Products {
                ProductID = 1, ProductName = "111111111111111", Discontinued = true
            };

            ValidationUnity.Validate(p);
        }
 public void GetValidationsParallelTest()
 {
     ValidationUnity.RegisterValidation(typeof(Products), new ProductQuantityValidateAttribute());
     Parallel.For(0, 100, (i) =>
     {
         var validations = ValidationUnity.GetValidations(typeof(Products));
         Console.WriteLine(validations.Count());
     });
 }
        public void ValidateWithCustomAttributeTest1()
        {
            var p = PropertyUnity.GetProperty(typeof(Orders), "CustomerID");

            ValidationUnity.RegisterValidation(p, new AnyValidateAttribute());
            var o = new Orders {
                CustomerID = "AA"
            };

            ValidationUnity.Validate(o);
        }
 public void RegisterValidationTest()
 {
     ValidationUnity.RegisterValidation(typeof(Products), new ProductQuantityValidateAttribute());
 }