public void AllowsEmptyAttributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.AttributeTypes = new Type[0]; apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"); }
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)); }
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)); }
public void DoesNotCreateProxyIfEmptyAtributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.AttributeTypes = new Type[0]; object result = apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"); Assert.IsFalse(AopUtils.IsAopProxy(result)); }
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)); }
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 ) ); }
public void ThrowsOnAssigningNullAttributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); Assert.Throws <ArgumentNullException>(() => apc.AttributeTypes = null); }
public void ThrowsOnMissingAttributeTypeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); Assert.Throws <ArgumentNullException>(() => apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject")); }
public void ThrowsOnAssigningNullAttributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.AttributeTypes = null; }
public void DefaultsToNotCheckInherited() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); Assert.IsFalse(apc.CheckInherited); }
public void ThrowsOnAssigningNullAttributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); Assert.Throws<ArgumentNullException>(() => apc.AttributeTypes = null); }
public void AllowsEmptyAttributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.AttributeTypes = new Type[0]; apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" ); }
public void ThrowsOnMissingAttributeTypeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" ); }
public void DoesNotCreateProxyIfEmptyAtributeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.AttributeTypes = new Type[0]; object result = apc.PostProcessAfterInitialization( new ApcTestObject(), "testObject" ); Assert.IsFalse( AopUtils.IsAopProxy( result ) ); }
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 ) ); }
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 ) ); }
public void ThrowsOnMissingAttributeTypeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject"); }
public void ThrowsOnMissingAttributeTypeList() { AttributeAutoProxyCreator apc = new AttributeAutoProxyCreator(); Assert.Throws<ArgumentNullException>(() => apc.PostProcessAfterInitialization(new ApcTestObject(), "testObject")); }