public void Unrestricted() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(SecurityAction.Assert); a.Unrestricted = true; IPermission perm = a.CreatePermission(); }
public void Zone_Invalid() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(SecurityAction.Assert); a.Zone = (SecurityZone)Int32.MinValue; // no validation in attribute }
public void Default() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(SecurityAction.Assert); Assert.AreEqual(a.ToString(), a.TypeId.ToString(), "TypeId"); Assert.IsFalse(a.Unrestricted, "Unrestricted"); Assert.AreEqual(SecurityZone.NoZone, a.Zone, "Zone"); ZoneIdentityPermission perm = (ZoneIdentityPermission)a.CreatePermission(); Assert.AreEqual(SecurityZone.NoZone, perm.SecurityZone, "CreatePermission-SecurityZone"); }
public void Zone() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(SecurityAction.Assert); Assert.AreEqual(SecurityZone.NoZone, a.Zone, "Zone=default"); a.Zone = SecurityZone.Internet; Assert.AreEqual(SecurityZone.Internet, a.Zone, "Zone=Internet"); a.Zone = SecurityZone.Intranet; Assert.AreEqual(SecurityZone.Intranet, a.Zone, "Zone=Intranet"); a.Zone = SecurityZone.MyComputer; Assert.AreEqual(SecurityZone.MyComputer, a.Zone, "Zone=MyComputer"); a.Zone = SecurityZone.NoZone; Assert.AreEqual(SecurityZone.NoZone, a.Zone, "Zone=NoZone"); a.Zone = SecurityZone.Trusted; Assert.AreEqual(SecurityZone.Trusted, a.Zone, "Zone=Trusted"); a.Zone = SecurityZone.Untrusted; Assert.AreEqual(SecurityZone.Untrusted, a.Zone, "Zone=Untrusted"); }
public void Action() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(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"); }
public static void ZoneIdentityPermissionAttributeCallMethods() { ZoneIdentityPermissionAttribute zipa = new ZoneIdentityPermissionAttribute(new Permissions.SecurityAction()); IPermission ip = zipa.CreatePermission(); }
public void Action_Invalid() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute((SecurityAction)Int32.MinValue); // no validation in attribute }
public void TypeId() { ZoneIdentityPermissionAttribute a = new ZoneIdentityPermissionAttribute(SecurityAction.Assert); Assert.AreEqual(a.ToString(), a.TypeId.ToString(), "TypeId"); }