public void IsSubset_Null()
        {
            EventLogPermission elp = new EventLogPermission(PermissionState.None);

#if NET_2_0
            Assert.IsTrue(elp.IsSubsetOf(null), "null");
#else
            Assert.IsFalse(elp.IsSubsetOf(null), "null");
#endif
        }
        public void IsSubset_Unrestricted()
        {
            // IsSubset with unrestricted
            // a. source (this) is unrestricted -> target is never a subset
            // b. destination (target) is unrestricted -> source is always a subset
            EventLogPermission elp1 = new EventLogPermission(PermissionState.Unrestricted);

            foreach (EventLogPermissionAccess elpa in AllAccess)
            {
                EventLogPermission elp2 = new EventLogPermission(PermissionState.None);
                elp2.PermissionEntries.Add(new EventLogPermissionEntry(elpa, elpa.ToString()));
                Assert.IsFalse(elp1.IsSubsetOf(elp2), "target " + elpa.ToString());
                Assert.IsTrue(elp2.IsSubsetOf(elp1), "source " + elpa.ToString());
            }
            Assert.IsTrue(elp1.IsSubsetOf(elp1), "Unrestricted.IsSubsetOf(Unrestricted)");
        }
 public void IsSubset_Self()
 {
     foreach (EventLogPermissionAccess elpa in AllAccess)
     {
         EventLogPermission elp = new EventLogPermission(PermissionState.None);
         elp.PermissionEntries.Add(new EventLogPermissionEntry(elpa, elpa.ToString()));
         Assert.IsTrue(elp.IsSubsetOf(elp), elpa.ToString());
     }
 }
// "special" behavior inherited from ResourceBasePermission
//		[ExpectedException (typeof (ArgumentException))]
        public void IsSubsetOf_BadPermission()
        {
            EventLogPermission elp1 = new EventLogPermission(PermissionState.Unrestricted);

            Assert.IsFalse(elp1.IsSubsetOf(new SecurityPermission(SecurityPermissionFlag.Assertion)));
        }
Beispiel #5
0
        public void IsSubset_Null()
        {
            EventLogPermission elp = new EventLogPermission(PermissionState.None);

            Assert.IsTrue(elp.IsSubsetOf(null), "null");
        }