Bladeren bron

2004-05-14 Atsushi Enomoto <[email protected]>

	* DataSetReadXmlSchemaTest.cs : Added test014.xsd tes (contains two
	  simple repeatable elements).

svn path=/trunk/mcs/; revision=27387
Atsushi Eno 21 jaren geleden
bovenliggende
commit
bf13e10685

+ 5 - 0
mcs/class/System.Data/Test/System.Data/ChangeLog

@@ -1,3 +1,8 @@
+2004-05-14  Atsushi Enomoto <[email protected]>
+
+	* DataSetReadXmlSchemaTest.cs : Added test014.xsd tes (contains two
+	  simple repeatable elements).
+
 2004-05-14  Atsushi Enomoto <[email protected]>
 
 	* DataSetTest.cs,

+ 26 - 0
mcs/class/System.Data/Test/System.Data/DataSetReadXmlSchemaTest.cs

@@ -672,5 +672,31 @@ namespace MonoTests.System.Data
 
 			AssertDataRelation ("rel", ds.Relations [0], "Foo_Bar", true, new string [] {"Foo_Id"}, new string [] {"Foo_Id"}, true, true);
 		}
+
+		[Test]
+		public void TestMoreThanOneRepeatableColumns ()
+		{
+			DataSet ds = new DataSet ();
+			ds.ReadXmlSchema ("Test/System.Data/schemas/test014.xsd");
+			AssertDataSet ("014", ds, "NewDataSet", 3, 2);
+
+			DataTable dt = ds.Tables [0];
+			AssertDataTable ("parent", dt, "root", 1, 0, 0, 2, 1, 1);
+			AssertDataColumn ("key", dt.Columns [0], "root_Id", false, true, 0, 1, "root_Id", MappingType.Hidden, typeof (int), DBNull.Value, String.Empty, -1, String.Empty, 0, String.Empty, false, true);
+
+			dt = ds.Tables [1];
+			AssertDataTable ("repeated", dt, "x", 2, 0, 1, 0, 1, 0);
+			AssertDataColumn ("data_1", dt.Columns [0], "x_Column", false, false, 0, 1, "x_Column", MappingType.SimpleContent, typeof (string), DBNull.Value, String.Empty, -1, String.Empty, 0, String.Empty, false, false);
+			AssertDataColumn ("refkey_1", dt.Columns [1], "root_Id", true, false, 0, 1, "root_Id", MappingType.Hidden, typeof (int), DBNull.Value, String.Empty, -1, String.Empty, 0, String.Empty, false, false);
+
+			dt = ds.Tables [2];
+			AssertDataTable ("repeated", dt, "y", 2, 0, 1, 0, 1, 0);
+			AssertDataColumn ("data", dt.Columns [0], "y_Column", false, false, 0, 1, "y_Column", MappingType.SimpleContent, typeof (string), DBNull.Value, String.Empty, -1, String.Empty, 0, String.Empty, false, false);
+			AssertDataColumn ("refkey", dt.Columns [1], "root_Id", true, false, 0, 1, "root_Id", MappingType.Hidden, typeof (int), DBNull.Value, String.Empty, -1, String.Empty, 0, String.Empty, false, false);
+
+			AssertDataRelation ("rel", ds.Relations [0], "root_x", true, new string [] {"root_Id"}, new string [] {"root_Id"}, true, true);
+
+			AssertDataRelation ("rel", ds.Relations [1], "root_y", true, new string [] {"root_Id"}, new string [] {"root_Id"}, true, true);
+		}
 	}
 }