public void DoesNotMatchWriteOnlyProperty() { ObjectWithProperties o = new ObjectWithProperties(); Matcher m = new PropertyMatcher("WriteOnlyProperty", new AlwaysMatcher(true, "anything")); Assert.IsFalse(m.Matches(o), "should not match o"); }
public void DoesNotMatchObjectIfItDoesNotHaveNamedProperty() { ObjectWithProperties o = new ObjectWithProperties(); Matcher m = new PropertyMatcher("OtherProperty", new AlwaysMatcher(true, "anything")); Assert.IsFalse(m.Matches(o), "should not match o"); }
public void MatchesObjectWithNamedPropertyAndMatchingPropertyValue() { ObjectWithProperties o = new ObjectWithProperties(); object aValue = new NamedObject("aValue"); o.A = aValue; Matcher m = new PropertyMatcher("A", Is.EqualTo(aValue)); Assert.IsTrue(m.Matches(o), "should match o"); }
public void DoesNotMatchObjectIfPropertyMatcherDoesNotMatch() { ObjectWithProperties o = new ObjectWithProperties(); object aValue = new NamedObject("aValue"); object otherValue = new NamedObject("otherValue"); o.A = aValue; Matcher m = new PropertyMatcher("A", new EqualMatcher(otherValue)); Assert.IsFalse(m.Matches(o), "should not match o"); }