Beispiel #1
0
        public void OriginalMethodCanBeNotInvoked()
        {
            dynamic test = new MyTestClass();

            test.SimpleMethod();

            Assert.IsFalse(test.OriginalMethodCalled);
        }
Beispiel #2
0
        public void OriginalMethodCanBeNotInvoked()
        {
            dynamic test = new MyTestClass();
            
            test.SimpleMethod();

            Assert.IsFalse(test.OriginalMethodCalled);
        }
Beispiel #3
0
        public void IntByRefArgumentShouldBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;
            test.MethodWithRefArgs(ref value);
            
            Assert.IsTrue(value == -1);
        }
Beispiel #4
0
        public void IntArgumentShouldNotBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;
            test.SimpleMethod(value);

            Assert.IsTrue(value == 5);
        }
Beispiel #5
0
        public void IntByRefArgumentShouldBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;

            test.MethodWithRefArgs(ref value);

            Assert.IsTrue(value == -1);
        }
Beispiel #6
0
        public void IntArgumentShouldNotBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;

            test.SimpleMethod(value);

            Assert.IsTrue(value == 5);
        }
Beispiel #7
0
        public void OriginalMethodCanBeInvokedWithInChaninOfExpressions()
        {
            dynamic test = new MyTestClass();

            string value1 = "9";
            string value2 = "9";
            test.SimpleMethod(Convert.ToInt32(value1) * Convert.ToInt32(value2) - 81);

            Assert.IsTrue(test.OriginalMethodCalled);
        }
Beispiel #8
0
        public void OriginalMethodCanBeInvokedWithInChaninOfExpressions()
        {
            dynamic test = new MyTestClass();

            string value1 = "9";
            string value2 = "9";

            test.SimpleMethod(Convert.ToInt32(value1) * Convert.ToInt32(value2) - 81);

            Assert.IsTrue(test.OriginalMethodCalled);
        }