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

            Temp.ItemA = "Test";
            Assert.DoesNotThrow <Exception>(() => TestObject.Validate(Temp));
            Temp.ItemA = "A test";
            Assert.Throws <NotValid>(() => TestObject.Validate(Temp));
        }