Наследование: CodeAccessSecurityAttribute
		public void Action () 
		{
			FileIOPermissionAttribute a = new FileIOPermissionAttribute (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
		}
		public void Default () 
		{
			FileIOPermissionAttribute a = new FileIOPermissionAttribute (SecurityAction.Assert);
			Assert.IsNull (a.Append, "Append");
			Assert.IsNull (a.PathDiscovery, "PathDiscovery");
			Assert.IsNull (a.Read, "Read");
			Assert.IsNull (a.Write, "Write");
			Assert.IsNotNull (a.AllFiles, "AllFiles");
			Assert.IsNotNull (a.AllLocalFiles, "AllLocalFiles");
			Assert.IsNull (a.ChangeAccessControl, "ChangeAccessControl");
			Assert.IsNull (a.ViewAccessControl, "ViewAccessControl");

			Assert.AreEqual (a.ToString (), a.TypeId.ToString (), "TypeId");
			Assert.IsFalse (a.Unrestricted, "Unrestricted");

			FileIOPermission perm = (FileIOPermission) a.CreatePermission ();
			Assert.AreEqual (FileIOPermissionAccess.NoAccess, perm.AllFiles, "CreatePermission-AllFiles");
			Assert.AreEqual (FileIOPermissionAccess.NoAccess, perm.AllLocalFiles, "CreatePermission-AllLocalFiles");
			Assert.IsFalse (perm.IsUnrestricted (), "perm-Unrestricted");
		}
		public void All () 
		{
			string filename = Assembly.GetCallingAssembly ().Location;
			FileIOPermissionAttribute attr = new FileIOPermissionAttribute (SecurityAction.Assert);
			attr.All = filename;
			Assert.AreEqual (filename, attr.Append, "All=Append");
			Assert.AreEqual (filename, attr.PathDiscovery, "All=PathDiscovery");
			Assert.AreEqual (filename, attr.Read, "All=Read");
			Assert.AreEqual (filename, attr.Write, "All=Write");
			Assert.IsNotNull (attr.AllFiles, "AllFiles");
			Assert.IsNotNull (attr.AllLocalFiles, "AllLocalFiles");
			Assert.IsNull (attr.ChangeAccessControl, "ChangeAccessControl");
			Assert.IsNull (attr.ViewAccessControl, "ViewAccessControl");
			FileIOPermission p = (FileIOPermission)attr.CreatePermission ();
			filename = Path.GetFullPath (filename);
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Append) [0], "All=FileIOPermissionAttribute-Append");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.PathDiscovery) [0], "All=FileIOPermissionAttribute-PathDiscovery");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Read) [0], "All=FileIOPermissionAttribute-Read");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Write) [0], "All=FileIOPermissionAttribute-Write");
		}
		public void NonC14NPath ()
		{
			string filename = Path.Combine (Path.GetTempPath (), "test");
			filename = Path.Combine (filename, "..");
			filename = Path.Combine (filename, "here");
			FileIOPermissionAttribute attr = new FileIOPermissionAttribute (SecurityAction.Assert);
			// attribute class will keep the .. in the path
			attr.All = filename;
			Assert.AreEqual (filename, attr.Append, "All=Append");
			Assert.AreEqual (filename, attr.PathDiscovery, "All=PathDiscovery");
			Assert.AreEqual (filename, attr.Read, "All=Read");
			Assert.AreEqual (filename, attr.Write, "All=Write");
			// but the permission class will c14n it
			filename = Path.GetFullPath (filename);
			FileIOPermission p = (FileIOPermission)attr.CreatePermission ();
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Append) [0], "All=FileIOPermissionAttribute-Append");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.PathDiscovery) [0], "All=FileIOPermissionAttribute-PathDiscovery");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Read) [0], "All=FileIOPermissionAttribute-Read");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Write) [0], "All=FileIOPermissionAttribute-Write");
		}
		public void Unrestricted () 
		{
			FileIOPermissionAttribute a = new FileIOPermissionAttribute (SecurityAction.Assert);
			a.Unrestricted = true;

			FileIOPermission perm = (FileIOPermission) a.CreatePermission ();
			Assert.IsTrue (perm.IsUnrestricted (), "CreatePermission.IsUnrestricted");
			Assert.AreEqual (FileIOPermissionAccess.AllAccess, perm.AllFiles, "CreatePermission.AllFiles");
			Assert.AreEqual (FileIOPermissionAccess.AllAccess, perm.AllLocalFiles, "CreatePermission.AllLocalFiles");
		}
		public void Write () 
		{
			string filename = Assembly.GetCallingAssembly ().Location;
			FileIOPermissionAttribute attr = new FileIOPermissionAttribute (SecurityAction.Assert);
			attr.Write = filename;
			Assert.IsNull (attr.Append, "Append=null");
			Assert.IsNull (attr.PathDiscovery, "PathDiscovery=null");
			Assert.IsNull (attr.Read, "Read=null");
			Assert.AreEqual (filename, attr.Write, "Write=Write");
			FileIOPermission p = (FileIOPermission) attr.CreatePermission ();
			filename = Path.GetFullPath (filename);
			Assert.IsNull (p.GetPathList (FileIOPermissionAccess.Append), "PathDiscovery=FileIOPermissionAttribute-Append");
			Assert.IsNull (p.GetPathList (FileIOPermissionAccess.PathDiscovery), "PathDiscovery=FileIOPermissionAttribute-PathDiscovery");
			Assert.IsNull (p.GetPathList (FileIOPermissionAccess.Read), "PathDiscovery=FileIOPermissionAttribute-Read");
			Assert.AreEqual (filename, p.GetPathList (FileIOPermissionAccess.Write) [0], "PathDiscovery=FileIOPermissionAttribute-Write");
		}
		public void ViewAndModify_Get ()
		{
			FileIOPermissionAttribute a = new FileIOPermissionAttribute (SecurityAction.Assert);
			a.ViewAndModify = "mono";
			Assert.AreEqual ("ViewAndModify", "mono", a.ViewAndModify);
		}
		public void ViewAndModify_Set ()
		{
			FileIOPermissionAttribute a = new FileIOPermissionAttribute (SecurityAction.Assert);
			a.ViewAndModify = "mono";
			Assert.AreEqual ("mono", a.Append, "Append");
			Assert.IsNull (a.ChangeAccessControl, "ChangeAccessControl");
			Assert.AreEqual ("mono", a.PathDiscovery, "PathDiscovery");
			Assert.AreEqual ("mono", a.Read, "Read");
			Assert.IsNull (a.ViewAccessControl, "ViewAccessControl");
			Assert.AreEqual ("mono", a.Write, "Write");

			a.ViewAndModify = null;
			Assert.IsNull (a.Append, "Append");
			Assert.IsNull (a.ChangeAccessControl, "ChangeAccessControl");
			Assert.IsNull (a.PathDiscovery, "PathDiscovery");
			Assert.IsNull (a.Read, "Read");
			Assert.IsNull (a.ViewAccessControl, "ViewAccessControl");
			Assert.IsNull (a.Write, "Write");
		}
		public void All_Get () 
		{
			FileIOPermissionAttribute attr = new FileIOPermissionAttribute (SecurityAction.Assert);
			string s = attr.All;
		}