예제 #1
0
        public void Unrestricted()
        {
            NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute(SecurityAction.Assert);

            Assert.IsFalse(a.Unrestricted, "Unrestricted (default)");
            a.Unrestricted = true;
            Assert.IsTrue(a.Unrestricted, "Unrestricted (true)");
            a.Unrestricted = false;
            Assert.IsFalse(a.Unrestricted, "Unrestricted (false)");
        }
예제 #2
0
		public void Action ()
		{
			NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute (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");
		}
예제 #3
0
        public void Action()
        {
            NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute(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");
        }
예제 #4
0
 public void Action_Invalid()
 {
     NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute((SecurityAction)Int32.MinValue);
     // no validation in attribute
 }
예제 #5
0
		public void Unrestricted ()
		{
			NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute (SecurityAction.Assert);
			Assert.IsFalse (a.Unrestricted, "Unrestricted (default)");
			a.Unrestricted = true;
			Assert.IsTrue (a.Unrestricted, "Unrestricted (true)");
			a.Unrestricted = false;
			Assert.IsFalse (a.Unrestricted, "Unrestricted (false)");
		}
예제 #6
0
		public void Action_Invalid ()
		{
			NonAbstractSecurityAttribute a = new NonAbstractSecurityAttribute ((SecurityAction)Int32.MinValue);
			// no validation in attribute
		}