Inheritance: CodeAccessSecurityAttribute
		public void Unrestricted () 
		{
			PublisherIdentityPermissionAttribute a = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			a.Unrestricted = true;
			IPermission perm = a.CreatePermission ();
		}
		public void Default () 
		{
			PublisherIdentityPermissionAttribute a = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			Assert.IsNull (a.CertFile, "CertFile");
			Assert.IsNull (a.SignedFile, "SignedFile");
			Assert.IsNull (a.X509Certificate, "X509Certificate");
			Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");
			Assert.IsFalse (a.Unrestricted, "Unrestricted");

			PublisherIdentityPermission perm = (PublisherIdentityPermission) a.CreatePermission ();
			Assert.IsNull (perm.Certificate, "CreatePermission.Certificate");
		}
		public void Priority () 
		{
			X509Certificate x509 = new X509Certificate (cert1);
			PublisherIdentityPermissionAttribute attr = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			attr.CertFile = "cert1.cer";
			attr.SignedFile = "cert2.cer";
			attr.X509Certificate = x509.GetRawCertDataString ();
			Assert.AreEqual ("cert1.cer", attr.CertFile, "CertFile");
			Assert.AreEqual ("cert2.cer", attr.SignedFile, "SignedFile");
			Assert.AreEqual (x509.GetRawCertDataString (), attr.X509Certificate, "X509Certificate");
			// from documentation X509Certificate has priority over CertFile and SignedFile
			PublisherIdentityPermission p = (PublisherIdentityPermission) attr.CreatePermission ();
			Assert.AreEqual (x509.GetRawCertDataString (), p.Certificate.GetRawCertDataString (), "p.Certificate");
			// but no word about CertFile and SignedFile priority
			attr.CertFile = "cert1.cer";
			attr.SignedFile = "cert2.cer";
			attr.X509Certificate = null;
			p = (PublisherIdentityPermission) attr.CreatePermission ();
			Assert.AreEqual (x509.GetRawCertDataString (), p.Certificate.GetRawCertDataString (), "p.Certificate");
			// CertFile !
		}
		public void X509CertificateProperty () 
		{
			X509Certificate x509 = new X509Certificate (cert2);
			PublisherIdentityPermissionAttribute attr = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			attr.CertFile = null;
			attr.SignedFile = null;
			attr.X509Certificate = x509.GetRawCertDataString ();
			Assert.IsNull (attr.CertFile, "CertFile");
			Assert.IsNull (attr.SignedFile, "SignedFile");
			Assert.AreEqual (x509.GetRawCertDataString (), attr.X509Certificate, "X509Certificate");
			PublisherIdentityPermission p = (PublisherIdentityPermission) attr.CreatePermission ();
			Assert.AreEqual (x509.GetRawCertDataString (), p.Certificate.GetRawCertDataString (), "X509CertificateProperty.Certificate");
		}
		public void None () 
		{
			PublisherIdentityPermissionAttribute attr = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			Assert.IsNull (attr.CertFile, "None.CertFile");
			Assert.IsNull (attr.SignedFile, "None.SignedFile");
			Assert.IsNull (attr.X509Certificate, "None.X509Certificate");
			PublisherIdentityPermission p = (PublisherIdentityPermission) attr.CreatePermission ();
			Assert.IsNull (p.Certificate, "None.CreatePermission");
		}
		public void Action_Invalid ()
		{
			PublisherIdentityPermissionAttribute a = new PublisherIdentityPermissionAttribute ((SecurityAction)Int32.MinValue);
			// no validation in attribute
		}
		public void Action () 
		{
			PublisherIdentityPermissionAttribute a = new PublisherIdentityPermissionAttribute (SecurityAction.Assert);
			Assert.AreEqual (SecurityAction.Assert, a.Action, "Action=Assert");
			a.Action = SecurityAction.Demand;
			Assert.AreEqual (SecurityAction.Demand, a.Action, "Action=Demand");
			a.Action = SecurityAction.Deny;
			Assert.AreEqual (SecurityAction.Deny, a.Action, "Action=Deny");
			a.Action = SecurityAction.InheritanceDemand;
			Assert.AreEqual (SecurityAction.InheritanceDemand, a.Action, "Action=InheritanceDemand");
			a.Action = SecurityAction.LinkDemand;
			Assert.AreEqual (SecurityAction.LinkDemand, a.Action, "Action=LinkDemand");
			a.Action = SecurityAction.PermitOnly;
			Assert.AreEqual (SecurityAction.PermitOnly, a.Action, "Action=PermitOnly");
			a.Action = SecurityAction.RequestMinimum;
			Assert.AreEqual (SecurityAction.RequestMinimum, a.Action, "Action=RequestMinimum");
			a.Action = SecurityAction.RequestOptional;
			Assert.AreEqual (SecurityAction.RequestOptional, a.Action, "Action=RequestOptional");
			a.Action = SecurityAction.RequestRefuse;
			Assert.AreEqual (SecurityAction.RequestRefuse, a.Action, "Action=RequestRefuse");
#if NET_2_0
			a.Action = SecurityAction.DemandChoice;
			Assert.AreEqual (SecurityAction.DemandChoice, a.Action, "Action=DemandChoice");
			a.Action = SecurityAction.InheritanceDemandChoice;
			Assert.AreEqual (SecurityAction.InheritanceDemandChoice, a.Action, "Action=InheritanceDemandChoice");
			a.Action = SecurityAction.LinkDemandChoice;
			Assert.AreEqual (SecurityAction.LinkDemandChoice, a.Action, "Action=LinkDemandChoice");
#endif
		}