ToXml() private method

private ToXml ( ) : SecurityElement
return System.Security.SecurityElement
		public void PermissionStateUnrestricted ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.Unrestricted);
			Assert.AreEqual (IsolatedStorageContainment.UnrestrictedIsolatedStorage, isfp.UsageAllowed, "UsageAllowed");
			Assert.AreEqual (Int64.MaxValue, isfp.UserQuota, "UserQuota");

			SecurityElement se = isfp.ToXml ();
			// only class and version are present
			Assert.AreEqual ("true", se.Attribute ("Unrestricted"), "Xml-Unrestricted");
			Assert.IsNull (se.Children, "Xml-Children");

			IsolatedStorageFilePermission copy = (IsolatedStorageFilePermission)isfp.Copy ();
			Assert.IsFalse (Object.ReferenceEquals (isfp, copy), "ReferenceEquals");
			Assert.AreEqual (isfp.UsageAllowed, copy.UsageAllowed, "UsageAllowed");
			Assert.AreEqual (isfp.UserQuota, copy.UserQuota, "UserQuota");
		}
		public void FromXml_NoVersion ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", se.Attribute ("class"));
			isfp.FromXml (w);
		}
		public void FromXml_WrongVersion ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();
			se.Attributes.Remove ("version");
			se.Attributes.Add ("version", "2");
			isfp.FromXml (se);
		}
		public void FromXml_NoClass ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("version", se.Attribute ("version"));
			isfp.FromXml (w);
			// doesn't even care of the class attribute presence
		}
		public void FromXml_WrongClass ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", "Wrong" + se.Attribute ("class"));
			w.AddAttribute ("version", se.Attribute ("version"));
			isfp.FromXml (w);
			// doesn't care of the class name at that stage
			// anyway the class has already be created so...
		}
		public void FromXml_WrongTagCase ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();
			se.Tag = "IPERMISSION"; // instead of IPermission
			isfp.FromXml (se);
		}
		public void FromXml_WrongTag ()
		{
			IsolatedStorageFilePermission isfp = new IsolatedStorageFilePermission (PermissionState.None);
			SecurityElement se = isfp.ToXml ();
			se.Tag = "IMono";
			isfp.FromXml (se);
		}