public void ShouldMatchOneOfMultipleMatchOptions()
 {
     IMatchingRule rule = new TypeMatchingRule(new MatchingInfo[]
                                                   {
                                                       new MatchingInfo(typeof(MyType1).FullName),
                                                       new MatchingInfo("MYTYPE2", true)
                                                   });
     Assert.IsTrue(rule.Matches(typeof(MyType1).GetMethod("TargetMethod")));
     Assert.IsFalse(rule.Matches(typeof(ANestedNamespace.MyType1).GetMethod("TargetMethod")));
     Assert.IsTrue(rule.Matches(typeof(MyType2).GetMethod("TargetMethod")));
 }
Ejemplo n.º 2
0
        public void ShouldMatchOneOfMultipleMatchOptions()
        {
            IMatchingRule rule = new TypeMatchingRule(new MatchingInfo[]
            {
                new MatchingInfo(typeof(MyType1).FullName),
                new MatchingInfo("MYTYPE2", true)
            });

            Assert.IsTrue(rule.Matches(typeof(MyType1).GetMethod("TargetMethod")));
            Assert.IsFalse(rule.Matches(typeof(ANestedNamespace.MyType1).GetMethod("TargetMethod")));
            Assert.IsTrue(rule.Matches(typeof(MyType2).GetMethod("TargetMethod")));
        }
Ejemplo n.º 3
0
        public void TestMatch(string typeName, Type typeToMatch, bool ignoreCase, bool shouldMatch)
        {
            TypeMatchingRule rule          = new TypeMatchingRule(typeName, ignoreCase);
            MethodInfo       methodToMatch = typeToMatch.GetMethod("TargetMethod");

            Assert.AreEqual(shouldMatch, rule.Matches(methodToMatch));
        }
 public void TestMatch(string typeName,
                       Type typeToMatch,
                       bool ignoreCase,
                       bool shouldMatch)
 {
     TypeMatchingRule rule = new TypeMatchingRule(typeName, ignoreCase);
     MethodInfo methodToMatch = typeToMatch.GetMethod("TargetMethod");
     Assert.AreEqual(shouldMatch, rule.Matches(methodToMatch));
 }