예제 #1
0
        public virtual void TestBasicInterceptionMethods()
        {
            IUnityContainer container = this.GetContainer();

            BasicInterceptionTestClass testClass = container.Resolve <BasicInterceptionTestClass>();

            testClass.MethodTest1();

            Assert.AreEqual(1, container.Resolve <TestCallHandler>("TestCallHandler").InterceptionCount);
        }
예제 #2
0
        public virtual void TestBasicInterceptionIndexers()
        {
            IUnityContainer container = this.GetContainer();

            BasicInterceptionTestClass testClass = container.Resolve <BasicInterceptionTestClass>();

            testClass[5] = new object();
            object o = testClass[3];

            Assert.AreEqual(2, container.Resolve <TestCallHandler>("TestCallHandler").InterceptionCount);
        }
예제 #3
0
        public virtual void TestBasicInterceptionProperties()
        {
            IUnityContainer container = this.GetContainer();

            BasicInterceptionTestClass testClass = container.Resolve <BasicInterceptionTestClass>();
            object o1 = testClass.PropertyTest1;

            testClass.PropertyTest2 = new object();
            testClass.PropertyTest3 = new object();
            object o2 = testClass.PropertyTest3;
            object o3 = testClass.PropertyTest4;

            Assert.AreEqual(5, container.Resolve <TestCallHandler>("TestCallHandler").InterceptionCount);
        }