Intersect() public method

public Intersect ( IPermission target ) : IPermission
target IPermission
return IPermission
Exemplo n.º 1
0
		public void Intersect_Different ()
		{
			SiteIdentityPermission sip1 = new SiteIdentityPermission (GoodSites [0]);
			SiteIdentityPermission sip2 = new SiteIdentityPermission (GoodSites [1]);
			SiteIdentityPermission result = (SiteIdentityPermission)sip1.Intersect (sip2);
			Assert.IsNull (result, "Mono N Novell");
		}
Exemplo n.º 2
0
		public void Intersect_None ()
		{
			SiteIdentityPermission sip1 = new SiteIdentityPermission (PermissionState.None);
			SiteIdentityPermission sip2 = new SiteIdentityPermission (PermissionState.None);
			SiteIdentityPermission result = (SiteIdentityPermission)sip1.Intersect (sip2);
			Assert.IsNull (result, "None N None");
			foreach (string s in GoodSites)	{
				sip1.Site = s;
				// 1. Intersect None with site
				result = (SiteIdentityPermission)sip1.Intersect (sip2);
				Assert.IsNull (result, "None N " + s);
				// 2. Intersect site with None
				result = (SiteIdentityPermission)sip2.Intersect (sip1);
				Assert.IsNull (result, s + "N None");
			}
		}
Exemplo n.º 3
0
		public void Intersect_Self ()
		{
			SiteIdentityPermission sip = new SiteIdentityPermission (PermissionState.None);
			foreach (string s in GoodSites)	{
				sip.Site = s;
				SiteIdentityPermission result = (SiteIdentityPermission)sip.Intersect (sip);
				Assert.AreEqual (s, result.Site, s);
			}
		}
Exemplo n.º 4
0
		public void Intersect_Null ()
		{
			SiteIdentityPermission sip = new SiteIdentityPermission (PermissionState.None);
			// No intersection with null
			foreach (string s in GoodSites)	{
				sip.Site = s;
				Assert.IsNull (sip.Intersect (null), s);
			}
		}