Пример #1
0
        public void PointcutAppliesToOneInterfaceOfSeveral()
        {
            IPointcut pointcut = new OneInterfaceTestPointcut();

            // Will return true if we're proxying interfaces including ITestObject
            Assert.IsTrue(AopUtils.CanApply(pointcut, typeof(TestObject), new Type[] { typeof(ITestObject), typeof(IComparable) }));

            // Will return true if we're proxying interfaces including ITestObject
            Assert.IsFalse(AopUtils.CanApply(pointcut, typeof(TestObject), new Type[] { typeof(IComparable) }));
        }
Пример #2
0
        public void PointcutAppliesToOneInterfaceOfSeveral()
        {
            IPointcut pointcut = new OneInterfaceTestPointcut();

            // Will return true if we're proxying interfaces including ITestObject 
            Assert.IsTrue(AopUtils.CanApply(pointcut, typeof (TestObject), new Type[] {typeof (ITestObject), typeof (IComparable)}));

            // Will return true if we're proxying interfaces including ITestObject 
            Assert.IsFalse(AopUtils.CanApply(pointcut, typeof (TestObject), new Type[] {typeof (IComparable)}));
        }