public void Initialize() { WxeDemandCreatePermissionAttribute attribute = new WxeDemandCreatePermissionAttribute(typeof(SecurableObject)); Assert.That(attribute.MethodType, Is.EqualTo(MethodType.Constructor)); Assert.That(attribute.SecurableClass, Is.SameAs(typeof(SecurableObject))); }
public void InitializeWithMethodTypeConstructor() { WxeDemandTargetPermissionAttribute attribute = new WxeDemandCreatePermissionAttribute(typeof(SecurableObject)); WxeDemandMethodPermissionAttributeHelper helper = new WxeDemandMethodPermissionAttributeHelper( typeof(TestFunctionWithThisObject), attribute); Assert.That(helper.FunctionType, Is.SameAs(typeof(TestFunctionWithThisObject))); Assert.That(helper.MethodType, Is.EqualTo(MethodType.Constructor)); Assert.That(helper.SecurableClass, Is.SameAs(typeof(SecurableObject))); Assert.That(helper.MethodName, Is.Null); }