public void Test()
 {
     Utilities.Validation.Rules.RequiredString<ClassD> TestObject = new RequiredString<ClassD>(x => x.ItemA, "", "Error");
     ClassD Temp = new ClassD();
     Temp.ItemA = "ASDF";
     Assert.DoesNotThrow<Exception>(() => TestObject.Validate(Temp));
     Temp.ItemA = "";
     Assert.Throws<NotValid>(() => TestObject.Validate(Temp));
 }
示例#2
0
        public void Test()
        {
            Utilities.Validation.Rules.RequiredString <ClassD> TestObject = new RequiredString <ClassD>(x => x.ItemA, "", "Error");
            ClassD Temp = new ClassD();

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