Intersect() public method

public Intersect ( IPermission target ) : IPermission
target IPermission
return IPermission
		public void Intersect_DifferentPermissions ()
		{
			StrongNameIdentityPermission a = new StrongNameIdentityPermission (PermissionState.None);
			SecurityPermission b = new SecurityPermission (PermissionState.None);
			Assert.IsNull (a.Intersect (b));
		}
		public void Intersect ()
		{
			StrongNamePublicKeyBlob blob = new StrongNamePublicKeyBlob (ecma);
			StrongNameIdentityPermission snip = new StrongNameIdentityPermission (blob, "mono", new Version (1, 2, 3, 4));

			StrongNameIdentityPermission intersect = (StrongNameIdentityPermission)snip.Intersect (null);
			Assert.IsNull (intersect, "snip N null");

			StrongNameIdentityPermission empty = new StrongNameIdentityPermission (PermissionState.None);
			intersect = (StrongNameIdentityPermission)snip.Intersect (empty);
#if NET_2_0
			Assert.IsNull (intersect, "snip N empty");
#else
			Compare (empty, intersect, "snip U empty");
#endif
			intersect = (StrongNameIdentityPermission)snip.Intersect (snip);
			Compare (snip, intersect, "snip U snip");

			StrongNameIdentityPermission samePk = new StrongNameIdentityPermission (blob, "novell", new Version (1, 2));
			intersect = (StrongNameIdentityPermission)snip.Intersect (samePk);
			Assert.IsNull (intersect, "(snip N samePk)");
			// strange, I would have expected a SNIP with the same public key...
		}