Exemple #1
0
 public void TestExactMatch()
 {
     // matched by exact overwrites all
     MethodAdviceContainer.Clear();
     NameExpressionTestTarget.NotMentionedToTestExactOverwrite();
     var content = MethodAdviceContainer.Content;
     MethodAdviceContainer.PrintContent(Console.Out);
     Assert.AreEqual(1, content.Count);
     Assert.AreEqual("Entry", content.ElementAt(0).Name);
 }
Exemple #2
0
        public void TextExcluded()
        {
            // excluded method
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.MethodNotToBeConcerned();
            var content = MethodAdviceContainer.Content;
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(0, content.Count);

            // excluded property
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.PropertyNotToBeConcerned = 2;
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(0, content.Count);
        }
Exemple #3
0
        public void TestNotMentioned()
        {
            // not mentioned method
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.MethodNotMentioned();
            var content = MethodAdviceContainer.Content;
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(0, content.Count);

            // not mentioned property
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.PropertyNotMentioned = 1;
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(0, content.Count);
        }
Exemple #4
0
        public void TestIncluded()
        {
            // included method
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.MethodToBeConcerned();
            var content = MethodAdviceContainer.Content;
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(1, content.Count);
            Assert.AreEqual("Entry", content.ElementAt(0).Name);

            // included property
            MethodAdviceContainer.Clear();
            NameExpressionTestTarget.PropertyToBeConcerned = 3;
            Console.Out.WriteLine(NameExpressionTestTarget.PropertyToBeConcerned);
            MethodAdviceContainer.PrintContent(Console.Out);
            Assert.AreEqual(1, content.Count);
            Assert.AreEqual("Entry", content.ElementAt(0).Name);
        }