public void DoesNotMatchWriteOnlyProperty()
        {
            var o = new ObjectWithProperties();

            Matcher m = new PropertyMatcher("WriteOnlyProperty", new AlwaysMatcher(true, "anything"));

            Assert.IsFalse(m.Matches(o), "should not match o");
        }
        public void DoesNotMatchObjectIfItDoesNotHaveNamedProperty()
        {
            var o = new ObjectWithProperties();

            Matcher m = new PropertyMatcher("OtherProperty", new AlwaysMatcher(true, "anything"));

            Assert.IsFalse(m.Matches(o), "should not match o");
        }
        public void DoesNotMatchObjectIfPropertyMatcherDoesNotMatch()
        {
            var o = new ObjectWithProperties();
            object aValue = new NamedObject("aValue");
            object otherValue = new NamedObject("otherValue");
            o.A = aValue;

            Matcher m = new PropertyMatcher("A", new SameMatcher(otherValue));

            Assert.IsFalse(m.Matches(o), "should not match o");
        }
        public void MatchesObjectWithNamedPropertyAndMatchingPropertyValue()
        {
            var o = new ObjectWithProperties();
            object aValue = new NamedObject("aValue");
            o.A = aValue;

            Matcher m = new PropertyMatcher("A", Is.Same(aValue));

            Assert.IsTrue(m.Matches(o), "should match o");
        }