Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
        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);
        }