public void Test()
 {
     Utilities.Validation.Rules.GreaterThanOrEqual<ClassA, int> TestObject = new GreaterThanOrEqual<ClassA, int>(x => x.ItemA, 3, "Error");
     ClassA Temp = new ClassA();
     Temp.ItemA = 3;
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = 2;
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
Esempio n. 2
0
        public void Test()
        {
            Utilities.Validation.Rules.GreaterThanOrEqual <ClassA, int> TestObject = new GreaterThanOrEqual <ClassA, int>(x => x.ItemA, 3, "Error");
            ClassA Temp = new ClassA();

            Temp.ItemA = 3;
            Assert.DoesNotThrow(() => TestObject.Validate(Temp));
            Temp.ItemA = 2;
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }