Esempio n. 1
0
        public void ShouldNotMatchWhenOneRuleDoesntMatch()
        {
            MethodBase      member  = GetType().GetMethod("ShouldNotMatchWhenOneRuleDoesntMatch");
            MatchingRuleSet ruleSet = new MatchingRuleSet();

            ruleSet.Add(new TypeMatchingRule(typeof(MatchingRuleSetFixture)));
            Assert.IsTrue(ruleSet.Matches(member));

            ruleSet.Add(new MemberNameMatchingRule("ThisMethodDoesntExist"));
            Assert.IsFalse(ruleSet.Matches(member));
        }
Esempio n. 2
0
        public void ShouldNotMatchWhenOneRuleDoesntMatch()
        {
            MethodBase member = GetType().GetMethod("ShouldNotMatchWhenOneRuleDoesntMatch");
            MatchingRuleSet ruleSet = new MatchingRuleSet();

            ruleSet.Add(new TypeMatchingRule(typeof(MatchingRuleSetFixture)));
            Assert.IsTrue(ruleSet.Matches(member));

            ruleSet.Add(new MemberNameMatchingRule("ThisMethodDoesntExist"));
            Assert.IsFalse(ruleSet.Matches(member));
        }
Esempio n. 3
0
 public void ShouldMatchWithMatchingTypeRule()
 {
     MatchingRuleSet ruleSet = new MatchingRuleSet();
     ruleSet.Add(new TypeMatchingRule(typeof(MatchingRuleSetFixture)));
     MethodBase member = GetType().GetMethod("ShouldMatchWithMatchingTypeRule");
     Assert.IsTrue(ruleSet.Matches(member));
 }
Esempio n. 4
0
        public void ShouldMatchTypeWithTypeMatchRule()
        {
            MatchingRuleSet ruleSet = new MatchingRuleSet();

            ruleSet.Add(new TypeMatchingAssignmentRule(typeof(MockDal)));
            Assert.IsTrue(ruleSet.Matches(typeof(MockDal)));
        }
Esempio n. 5
0
        public void ShouldMatchWithMatchingTypeRule()
        {
            MatchingRuleSet ruleSet = new MatchingRuleSet();

            ruleSet.Add(new TypeMatchingRule(typeof(MatchingRuleSetFixture)));
            MethodBase member = GetType().GetMethod("ShouldMatchWithMatchingTypeRule");

            Assert.IsTrue(ruleSet.Matches(member));
        }