コード例 #1
0
        public void AllowsEmptyAttributeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = new Type[0];
            apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject");
        }
コード例 #2
0
        public void CreatesProxyOnAttributeMatch()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };

            object result = apc.PostProcessAfterInitialization(new AttributedApcTestObject(), "testObject");

            Assert.IsTrue(AopUtils.IsAopProxy(result));
        }
コード例 #3
0
        public void DoesNotCreateProxyOnInheritedAttributeMatchWhenNotCheckInherited()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };
            apc.CheckInherited = false;
            object result = apc.PostProcessAfterInitialization(new DerivedAttributedApcTestObject(), "testObject");

            Assert.IsFalse(AopUtils.IsAopProxy(result));
        }
コード例 #4
0
        public void DoesNotCreateProxyIfEmptyAtributeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = new Type[0];

            object result = apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject");

            Assert.IsFalse(AopUtils.IsAopProxy(result));
        }
コード例 #5
0
        public void DoesNotCheckMethodLevelAttributes()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };
            apc.CheckInherited = false; // (!)

            // does not check method level attributes!
            object result = apc.PostProcessAfterInitialization(new DerivedAttributedApcTestObject(), "testObject");

            Assert.IsFalse(AopUtils.IsAopProxy(result));
        }
コード例 #6
0
 public void CreatesProxyOnInheritedAttributeMatchWhenCheckInherited()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };
     apc.CheckInherited = true;            
     object result = apc.PostProcessAfterInitialization( new DerivedAttributedApcTestObject(), "testObject" );
     Assert.IsTrue( AopUtils.IsAopProxy( result ) );
 }
コード例 #7
0
        public void ThrowsOnAssigningNullAttributeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            Assert.Throws <ArgumentNullException>(() => apc.AttributeTypes = null);
        }
コード例 #8
0
        public void ThrowsOnMissingAttributeTypeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            Assert.Throws <ArgumentNullException>(() => apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"));
        }
コード例 #9
0
        public void ThrowsOnAssigningNullAttributeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.AttributeTypes = null;
        }
コード例 #10
0
        public void DefaultsToNotCheckInherited()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            Assert.IsFalse(apc.CheckInherited);
        }
コード例 #11
0
 public void ThrowsOnAssigningNullAttributeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     Assert.Throws<ArgumentNullException>(() => apc.AttributeTypes = null);
 }
コード例 #12
0
 public void AllowsEmptyAttributeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.AttributeTypes = new Type[0];     
     apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" );
 }
コード例 #13
0
 public void DefaultsToNotCheckInherited()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     Assert.IsFalse(apc.CheckInherited);            
 }
コード例 #14
0
 public void ThrowsOnAssigningNullAttributeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.AttributeTypes = null;
 }
コード例 #15
0
 public void ThrowsOnMissingAttributeTypeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" );
 }
コード例 #16
0
 public void DoesNotCreateProxyIfEmptyAtributeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.AttributeTypes = new Type[0];
     
     object result = apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" );
     Assert.IsFalse( AopUtils.IsAopProxy( result ) );
 }
コード例 #17
0
        public void DoesNotCheckMethodLevelAttributes()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
            apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };
            apc.CheckInherited = false; // (!)

            // does not check method level attributes!
            object result = apc.PostProcessAfterInitialization( new DerivedAttributedApcTestObject(), "testObject" );
            Assert.IsFalse( AopUtils.IsAopProxy( result ) );
        }
コード例 #18
0
 public void DoesNotCreateProxyIfNoAttributeMatch()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     apc.AttributeTypes = new Type[] { typeof(ApcTestAttribute) };
     
     object result = apc.PostProcessAfterInitialization( new TestObject(), "testObject" );
     Assert.IsFalse( AopUtils.IsAopProxy( result ) );
 }
コード例 #19
0
        public void ThrowsOnMissingAttributeTypeList()
        {
            AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();

            apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject");
        }
コード例 #20
0
 public void ThrowsOnMissingAttributeTypeList()
 {
     AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator();
     Assert.Throws<ArgumentNullException>(() => apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"));
 }