예제 #1
0
		public void ToXml ()
		{
			ConfigurationPermission p = new ConfigurationPermission (PermissionState.Unrestricted);

#if NET_4_0
			Assert.AreEqual(
					"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"\nUnrestricted=\"true\"/>\n",
					p.ToString().Replace ("\r\n", "\n"), "A1");
#else
			Assert.AreEqual (
					"<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"\nUnrestricted=\"true\"/>\n",
					p.ToString ().Replace ("\r\n", "\n"), "A1");
#endif

			p = new ConfigurationPermission (PermissionState.None);

#if NET_4_0
			Assert.AreEqual (
					 "<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"/>\n",
					 p.ToString().Replace ("\r\n", "\n"), "A2");
#else
			Assert.AreEqual (
					 "<IPermission class=\"System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\nversion=\"1\"/>\n",
					 p.ToString ().Replace ("\r\n", "\n"), "A2");
#endif
		}