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