예제 #1
0
        public void IsInheritanceBasedProxy()
        {
            using (var ctx = new XmlApplicationContext(ReadOnlyXmlTestResource.GetFilePath("IsAopProxyTests.xml", this.GetType())))
            {
                var proxy = (TestObject)ctx["michael"];
                Assert.AreEqual("Michael", proxy.Name);

                Assert.True(AopUtils.IsInheritanceAopProxyType(proxy.GetType()));
                Assert.True(AopUtils.IsAopProxyType(proxy.GetType()));

                Assert.True(AopUtils.IsInheritanceAopProxy(proxy));
                Assert.True(AopUtils.IsAopProxy(proxy));
            }
        }
예제 #2
0
 public void IsInheritanceBasedProxyReturnsFalseForNull()
 {
     Assert.False(AopUtils.IsInheritanceAopProxy(null));
 }
예제 #3
0
 public void TargetIsNotAProxy()
 {
     Assert.False(AopUtils.IsAopProxy(_target));
     Assert.False(AopUtils.IsInheritanceAopProxy(_target));
     Assert.False(AopUtils.IsInheritanceAopProxyType(_target.GetType()));
 }