Exemple #1
0
        public void IsSubset()
        {
            DnsPermission dpn = new DnsPermission(PermissionState.None);
            DnsPermission dpu = new DnsPermission(PermissionState.Unrestricted);

            Assert.IsTrue(dpn.IsSubsetOf(null), "None IsSubsetOf null");
            Assert.IsFalse(dpu.IsSubsetOf(null), "Unrestricted IsSubsetOf null");

            Assert.IsTrue(dpn.IsSubsetOf(dpn), "None IsSubsetOf None");
            Assert.IsTrue(dpu.IsSubsetOf(dpu), "Unrestricted IsSubsetOf Unrestricted");

            Assert.IsTrue(dpn.IsSubsetOf(dpu), "None IsSubsetOf Unrestricted");
            Assert.IsFalse(dpu.IsSubsetOf(dpn), "Unrestricted IsSubsetOf None");
        }
Exemple #2
0
 private void Subset(DnsPermission Permission1)
 {
     if (permission.IsSubsetOf(Permission1))
     {
         Console.WriteLine("Current 'DnsPermission' instance is a subset of specified 'DnsPermission' instance.");
     }
     else
     {
         Console.WriteLine("Current 'DnsPermission' instance is not a subset of specified 'DnsPermission' instance.");
     }
 }
Exemple #3
0
        public void IsSubset_BadPermission()
        {
            DnsPermission dp = new DnsPermission(PermissionState.None);

            dp.IsSubsetOf(new SecurityPermission(PermissionState.Unrestricted));
        }