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)); }
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)); }