예제 #1
0
 public void OnEntry_ShouldChange_StringArgument_PassedAsRef()
 {
     dynamic myTest = new MyTestClass();
     string argument = "argument";
     string ret = myTest.ResturnStringArgumentPassedAsRef(ref argument);
     Assert.AreNotEqual(ret, "argument");
 }
예제 #2
0
        public void OnEntry_ShouldNotChange_StringArgument()
        {
            dynamic myTest   = new MyTestClass();
            string  argument = myTest.ResturnStringArgument("argument");

            Assert.AreEqual(argument, "argument");
        }
예제 #3
0
        public void OnEntry_ShouldChange_StringArgument_PassedAsRef()
        {
            dynamic myTest   = new MyTestClass();
            string  argument = "argument";
            string  ret      = myTest.ResturnStringArgumentPassedAsRef(ref argument);

            Assert.AreNotEqual(ret, "argument");
        }
예제 #4
0
        public void IntByRefArgumentShouldBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;
            test.MethodWithRefArgs(ref value);

            Assert.IsTrue(value == -1);
        }
예제 #5
0
        public void OnEntry_ShouldHaveAbilityToChange_ReferenceArgument()
        {
            var entity = new TestEntity {Name = "Name", Number = 0};

            dynamic myTest = new MyTestClass();
            myTest.ResturnObjectArgument(entity);

            Assert.AreEqual("ChangedName", entity.Name);
            Assert.AreEqual(999, entity.Number);
        }
예제 #6
0
        public void IntByRefArgumentShouldBeUpdatedByAspect()
        {
            dynamic test = new MyTestClass();

            int value = 5;

            test.MethodWithRefArgs(ref value);

            Assert.IsTrue(value == -1);
        }
예제 #7
0
        public void OnEntry_ShouldHaveAbilityToChange_ReferenceArgument()
        {
            var entity = new TestEntity {
                Name = "Name", Number = 0
            };

            dynamic myTest = new MyTestClass();

            myTest.ResturnObjectArgument(entity);

            Assert.AreEqual("ChangedName", entity.Name);
            Assert.AreEqual(999, entity.Number);
        }
예제 #8
0
 public void OnEntry_ShouldNotChange_StringArgument()
 {
     dynamic myTest = new MyTestClass();
     string argument = myTest.ResturnStringArgument("argument");
     Assert.AreEqual(argument, "argument");
 }