public void Unrestricted()
        {
            SiteIdentityPermissionAttribute a = new SiteIdentityPermissionAttribute(SecurityAction.Assert);

            a.Unrestricted = true;
            IPermission perm = a.CreatePermission();
        }
        public void Default()
        {
            SiteIdentityPermissionAttribute a = new SiteIdentityPermissionAttribute(SecurityAction.Assert);

            Assert.IsNull(a.Site, "Site");
            Assert.AreEqual(a.ToString(), a.TypeId.ToString(), "TypeId");
            Assert.IsFalse(a.Unrestricted, "Unrestricted");
        }
        public void Site()
        {
            SiteIdentityPermissionAttribute a = new SiteIdentityPermissionAttribute(SecurityAction.Assert);

            a.Site = "mono";
            Assert.AreEqual("mono", a.Site, "Site-1");
            a.Site = null;
            Assert.IsNull(a.Site, "Site-2");
            a.Site = "mono again";
            Assert.AreEqual("mono again", a.Site, "Site-3");
        }
        public void DefaultPermission()
        {
            SiteIdentityPermissionAttribute a = new SiteIdentityPermissionAttribute(SecurityAction.Assert);

            Assert.IsNull(a.Site, "Site");
            // SiteIdentityPermission would throw a ArgumentException for a null site ...
            SiteIdentityPermission perm = (SiteIdentityPermission)a.CreatePermission();

            // ... but this works ...
            Assert.IsNotNull(perm, "CreatePermission(null site)");
            // ... but this doesn't! (FIXED IN 2.0 NOV CTP)
            string site = perm.Site;
        }
        public void Action()
        {
            SiteIdentityPermissionAttribute a = new SiteIdentityPermissionAttribute(SecurityAction.Assert);

            Assert.AreEqual(SecurityAction.Assert, a.Action, "Action=Assert");
            a.Action = SecurityAction.Demand;
            Assert.AreEqual(SecurityAction.Demand, a.Action, "Action=Demand");
            a.Action = SecurityAction.Deny;
            Assert.AreEqual(SecurityAction.Deny, a.Action, "Action=Deny");
            a.Action = SecurityAction.InheritanceDemand;
            Assert.AreEqual(SecurityAction.InheritanceDemand, a.Action, "Action=InheritanceDemand");
            a.Action = SecurityAction.LinkDemand;
            Assert.AreEqual(SecurityAction.LinkDemand, a.Action, "Action=LinkDemand");
            a.Action = SecurityAction.PermitOnly;
            Assert.AreEqual(SecurityAction.PermitOnly, a.Action, "Action=PermitOnly");
            a.Action = SecurityAction.RequestMinimum;
            Assert.AreEqual(SecurityAction.RequestMinimum, a.Action, "Action=RequestMinimum");
            a.Action = SecurityAction.RequestOptional;
            Assert.AreEqual(SecurityAction.RequestOptional, a.Action, "Action=RequestOptional");
            a.Action = SecurityAction.RequestRefuse;
            Assert.AreEqual(SecurityAction.RequestRefuse, a.Action, "Action=RequestRefuse");
        }
Ejemplo n.º 6
0
 public static void SiteIdentityPermissionAttributeCallMethods()
 {
     SiteIdentityPermissionAttribute sipa = new SiteIdentityPermissionAttribute(new Permissions.SecurityAction());
     IPermission ip = sipa.CreatePermission();
 }
Ejemplo n.º 7
0
 public static void SiteIdentityPermissionAttributeCallMethods()
 {
     SiteIdentityPermissionAttribute sipa = new SiteIdentityPermissionAttribute(new Permissions.SecurityAction());
     IPermission ip = sipa.CreatePermission();
 }