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));
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Checks, if the given <paramref name="targetSource"/> holds a proxy generated by this factory.
 /// </summary>
 /// <returns></returns>
 protected virtual bool IsAopProxyType(ITargetSource targetSource)
 {
     return(AopUtils.IsAopProxyType(targetSource.TargetType));
 }