public void Initialize_WithMethodNameEnum()
        {
            WxeDemandTargetStaticMethodPermissionAttribute attribute = new WxeDemandTargetStaticMethodPermissionAttribute(SecurableObject.Method.Search);

            Assert.That(attribute.MethodType, Is.EqualTo(MethodType.Static));
            Assert.That(attribute.MethodName, Is.EqualTo("Search"));
            Assert.That(attribute.SecurableClass, Is.SameAs(typeof(SecurableObject)));
        }
Example #2
0
        public void InitializeWithMethodTypeStaticAndMethodEnum()
        {
            WxeDemandTargetStaticMethodPermissionAttribute attribute = new WxeDemandTargetStaticMethodPermissionAttribute(SecurableObject.Method.Search);

            WxeDemandMethodPermissionAttributeHelper helper = new WxeDemandMethodPermissionAttributeHelper(
                typeof(TestFunctionWithThisObject),
                attribute);

            Assert.That(helper.FunctionType, Is.SameAs(typeof(TestFunctionWithThisObject)));
            Assert.That(helper.MethodType, Is.EqualTo(MethodType.Static));
            Assert.That(helper.SecurableClass, Is.SameAs(typeof(SecurableObject)));
            Assert.That(helper.MethodName, Is.EqualTo("Search"));
        }