public void PropertyIsWithNestedProperties() { ThingWithProps t = new ThingWithProps(); Assertion.Assert(new PropertyIs("MyProp.Length", 5).Eval(t)); Assertion.Assert(!new PropertyIs("MyProp.Length", 9).Eval(t)); }
public void PropertyIs() { ThingWithProps t = new ThingWithProps(); // test property equals a value Assertion.Assert(new PropertyIs("MyProp", "hello").Eval(t)); Assertion.Assert(!new PropertyIs("MyProp", "bye").Eval(t)); // test property using another constraint Assertion.Assert(new PropertyIs("MyProp", new IsMatch("ell")).Eval(t)); Assertion.Assert(!new PropertyIs("MyProp", new IsMatch("sfsl")).Eval(t)); Assertion.AssertEquals( "Property MyProp: <x>", new PropertyIs("MyProp", new IsEqual("x")).Message); }