예제 #1
0
 public void Test()
 {
     Utilities.Validation.Rules.Between<ClassA, int> TestObject = new Between<ClassA, int>(x => x.ItemA, 1, 5, "Error");
     ClassA Temp=new ClassA();
     Temp.ItemA=1;
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = 0;
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
예제 #2
0
        public void Test()
        {
            Utilities.Validation.Rules.Between <ClassA, int> TestObject = new Between <ClassA, int>(x => x.ItemA, 1, 5, "Error");
            ClassA Temp = new ClassA();

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