Explorar el Código

2004-04-24 Atsushi Enomoto <[email protected]>

	* XmlDeclarationTests.cs : More InnerText tests.

svn path=/trunk/mcs/; revision=25934
Atsushi Eno hace 21 años
padre
commit
97bc8e7584

+ 4 - 0
mcs/class/System.XML/Test/System.Xml/ChangeLog

@@ -1,3 +1,7 @@
+2004-04-24  Atsushi Enomoto <[email protected]>
+
+	* XmlDeclarationTests.cs : More InnerText tests.
+
 2004-04-20  Atsushi Enomoto <[email protected]>
 
 	* XmlCharacterDataTests.cs : Added more tests for Substring().

+ 52 - 0
mcs/class/System.XML/Test/System.Xml/XmlDeclarationTests.cs

@@ -97,6 +97,23 @@ namespace MonoTests.System.Xml
 			AssertEquals ("null Encoding property", String.Empty, d2.Encoding);
 		}
 
+		[Test]
+		public void ValidInnerText ()
+		{
+			declaration.InnerText = "version='1.0'";
+
+			declaration.InnerText = "version='1.0' encoding='euc-jp'";
+
+			declaration.InnerText = "version='1.0'   standalone='no'";
+
+			declaration.InnerText = "version='1.0' encoding='iso-8859-1' standalone=\"yes\"";
+
+			declaration.InnerText = @"version = '1.0' encoding	=
+				'euc-jp'  standalone	 =	'yes'    ";
+
+			declaration.InnerText = "  version = '1.0'";
+		}
+
 		[Test]
 		[ExpectedException (typeof (XmlException))]
 		public void InvalidInnerText ()
@@ -104,6 +121,41 @@ namespace MonoTests.System.Xml
 			declaration.InnerText = "version='1.0a'";
 		}
 
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void InvalidInnerText2 ()
+		{
+			declaration.InnerText = "version='1.0'  encoding='euc-kr\"";
+		}
+
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void InvalidInnerText3 ()
+		{
+			declaration.InnerText = "version='2.0'";
+		}
+
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void InvalidInnerText4 ()
+		{
+			declaration.InnerText = "version='1.0' standalone='Yeah!!!!!'";
+		}
+
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void InvalidInnerText5 ()
+		{
+			declaration.InnerText = "version='1.0'standalone='yes'";
+		}
+
+		[Test]
+		[ExpectedException (typeof (XmlException))]
+		public void InvalidInnerText6 ()
+		{
+			declaration.InnerText = "version='1.0'standalone='yes' encoding='utf-8'";
+		}
+
 		[Test]
 		public void StandaloneProperty ()
 		{