public void ShouldNotMatchGetWithSetOption()
 {
     IMatchingRule rule =
         new PropertyMatchingRule("MyProperty", PropertyMatchingOption.Set);
     Assert.IsFalse(rule.Matches(getMyProperty));
     Assert.IsTrue(rule.Matches(setMyProperty));
 }
 public void ShouldMatchPropertyName()
 {
     IMatchingRule rule =
         new PropertyMatchingRule("MyProperty");
     Assert.IsTrue(rule.Matches(getMyProperty));
     Assert.IsTrue(rule.Matches(setMyProperty));
 }
 public void ShouldMatchWithWildcard()
 {
     IMatchingRule rule =
         new PropertyMatchingRule("My*");
     Assert.IsTrue(rule.Matches(getMyProperty));
     Assert.IsTrue(rule.Matches(setMyProperty));
     Assert.IsTrue(rule.Matches(getMyOtherProperty));
 }
        public void ShouldNotMatchGetWithSetOption()
        {
            IMatchingRule rule =
                new PropertyMatchingRule("MyProperty", PropertyMatchingOption.Set);

            Assert.IsFalse(rule.Matches(getMyProperty));
            Assert.IsTrue(rule.Matches(setMyProperty));
        }
        public void ShouldMatchPropertyName()
        {
            IMatchingRule rule =
                new PropertyMatchingRule("MyProperty");

            Assert.IsTrue(rule.Matches(getMyProperty));
            Assert.IsTrue(rule.Matches(setMyProperty));
        }
        public void ShouldMatchWithWildcard()
        {
            IMatchingRule rule =
                new PropertyMatchingRule("My*");

            Assert.IsTrue(rule.Matches(getMyProperty));
            Assert.IsTrue(rule.Matches(setMyProperty));
            Assert.IsTrue(rule.Matches(getMyOtherProperty));
        }
 public void ShouldMatchWithMultipleMatchTargets()
 {
     IMatchingRule rule = new PropertyMatchingRule(new PropertyMatchingInfo[]
                                                       {
                                                           new PropertyMatchingInfo("MyProperty"),
                                                           new PropertyMatchingInfo("ACompletelyDifferentProperty", PropertyMatchingOption.Set)
                                                       });
     Assert.IsTrue(rule.Matches(getMyProperty));
     Assert.IsTrue(rule.Matches(setMyProperty));
     Assert.IsFalse(rule.Matches(getMyOtherProperty));
     Assert.IsFalse(rule.Matches(getACompletelyDifferentProperty));
     Assert.IsTrue(rule.Matches(setACompletelyDifferentProperty));
 }
        public void ShouldMatchWithMultipleMatchTargets()
        {
            IMatchingRule rule = new PropertyMatchingRule(new PropertyMatchingInfo[]
            {
                new PropertyMatchingInfo("MyProperty"),
                new PropertyMatchingInfo("ACompletelyDifferentProperty", PropertyMatchingOption.Set)
            });

            Assert.IsTrue(rule.Matches(getMyProperty));
            Assert.IsTrue(rule.Matches(setMyProperty));
            Assert.IsFalse(rule.Matches(getMyOtherProperty));
            Assert.IsFalse(rule.Matches(getACompletelyDifferentProperty));
            Assert.IsTrue(rule.Matches(setACompletelyDifferentProperty));
        }
 public void ShouldNotMatchPathologiciallyNamedMethod()
 {
     IMatchingRule rule = new PropertyMatchingRule("NotAProperty");
     Assert.IsFalse(rule.Matches(setNotAProperty));
 }
        public void ShouldNotMatchPathologiciallyNamedMethod()
        {
            IMatchingRule rule = new PropertyMatchingRule("NotAProperty");

            Assert.IsFalse(rule.Matches(setNotAProperty));
        }