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