IsSubsetOf() публичный Метод

public IsSubsetOf ( IPermission target ) : bool
target IPermission
Результат bool
Пример #1
0
		public void IsSubsetOfBadPermission () 
		{
			ReflectionPermission p1 = new ReflectionPermission (ReflectionPermissionFlag.NoFlags);
			EnvironmentPermission ep2 = new EnvironmentPermission (PermissionState.Unrestricted);
			Assert.IsTrue (p1.IsSubsetOf (ep2), "IsSubsetOf(EnvironmentPermission)");
		}
Пример #2
0
		public void IsSubsetOf () 
		{
			ReflectionPermission p1 = new ReflectionPermission (ReflectionPermissionFlag.MemberAccess);
			ReflectionPermission p2 = new ReflectionPermission (ReflectionPermissionFlag.TypeInformation);
			ReflectionPermission p3 = new ReflectionPermission (ReflectionPermissionFlag.ReflectionEmit);
			Assert.IsTrue (!p1.IsSubsetOf (p2), "MemberAccess.IsSubsetOf(TypeInformation)");
			Assert.IsTrue (!p1.IsSubsetOf (p3), "MemberAccess.IsSubsetOf(ReflectionEmit)");
			Assert.IsTrue (!p2.IsSubsetOf (p1), "TypeInformation.IsSubsetOf(MemberAccess)");
			Assert.IsTrue (!p2.IsSubsetOf (p3), "TypeInformation.IsSubsetOf(ReflectionEmit)");
			Assert.IsTrue (!p3.IsSubsetOf (p1), "ReflectionEmit.IsSubsetOf(MemberAccess)");
			Assert.IsTrue (!p3.IsSubsetOf (p2), "ReflectionEmit.IsSubsetOf(TypeInformation)");
			ReflectionPermission p4 = new ReflectionPermission (ReflectionPermissionFlag.AllFlags);
			Assert.IsTrue (p1.IsSubsetOf (p4), "MemberAccess.IsSubsetOf(AllFlags)");
			Assert.IsTrue (p2.IsSubsetOf (p4), "TypeInformation.IsSubsetOf(AllFlags)");
			Assert.IsTrue (p3.IsSubsetOf (p4), "ReflectionEmit.IsSubsetOf(AllFlags)");
			Assert.IsTrue (!p4.IsSubsetOf (p1), "AllFlags.IsSubsetOf(MemberAccess)");
			Assert.IsTrue (!p4.IsSubsetOf (p2), "AllFlags.IsSubsetOf(TypeInformation)");
			Assert.IsTrue (!p4.IsSubsetOf (p3), "AllFlags.IsSubsetOf(ReflectionEmit)");
		}
Пример #3
0
		public void IsSubsetOfUnrestricted () 
		{
			ReflectionPermission p1 = new ReflectionPermission (PermissionState.Unrestricted);
			ReflectionPermission p2 = new ReflectionPermission (ReflectionPermissionFlag.NoFlags);
			ReflectionPermission p3 = new ReflectionPermission (PermissionState.Unrestricted);
			Assert.IsTrue (!p1.IsSubsetOf (p2), "Unrestricted.IsSubsetOf()");
			Assert.IsTrue (p2.IsSubsetOf (p1), "IsSubsetOf(Unrestricted)");
			Assert.IsTrue (p1.IsSubsetOf (p3), "Unrestricted.IsSubsetOf(Unrestricted)");
		}
Пример #4
0
		public void IsSubsetOfNull () 
		{
			ReflectionPermission p = new ReflectionPermission (ReflectionPermissionFlag.NoFlags);
			Assert.IsTrue (p.IsSubsetOf (null), "NoFlags.IsSubsetOf(null)");
			p = new ReflectionPermission (ReflectionPermissionFlag.MemberAccess);
			Assert.IsTrue (!p.IsSubsetOf (null), "MemberAccess.IsSubsetOf(null)");
		}
		public void IsSubsetOfUnrestricted () 
		{
			ReflectionPermission p1 = new ReflectionPermission (PermissionState.Unrestricted);
			ReflectionPermission p2 = new ReflectionPermission (ReflectionPermissionFlag.NoFlags);
			ReflectionPermission p3 = new ReflectionPermission (PermissionState.Unrestricted);
			Assert ("Unrestricted.IsSubsetOf()", !p1.IsSubsetOf (p2));
			Assert ("IsSubsetOf(Unrestricted)", p2.IsSubsetOf (p1));
			Assert ("Unrestricted.IsSubsetOf(Unrestricted)", p1.IsSubsetOf (p3));
		}
		public void IsSubsetOfNull () 
		{
			ReflectionPermission p = new ReflectionPermission (ReflectionPermissionFlag.NoFlags);
			Assert ("NoFlags.IsSubsetOf(null)", p.IsSubsetOf (null));
			p = new ReflectionPermission (ReflectionPermissionFlag.MemberAccess);
			Assert ("MemberAccess.IsSubsetOf(null)", !p.IsSubsetOf (null));
		}