2004-04-09 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 9 Apr 2004 08:17:10 +0000 (08:17 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 9 Apr 2004 08:17:10 +0000 (08:17 -0000)
* DataColumnTest.cs,
  DataRowTest.cs,
  DataTableTest.cs : build fix: csc does not allow
  System.Type inside namespace MonoTests.System.Data.
* DataSetTest.cs : path fix.
* DataRelationTest.cs : path fix. Don't test error message: It should
  vary by message translations. Split tests and use ExpectedException.

svn path=/trunk/mcs/; revision=25242

mcs/class/System.Data/Test/System.Data/ChangeLog
mcs/class/System.Data/Test/System.Data/DataColumnTest.cs
mcs/class/System.Data/Test/System.Data/DataRelationTest.cs
mcs/class/System.Data/Test/System.Data/DataRowTest.cs
mcs/class/System.Data/Test/System.Data/DataSetTest.cs
mcs/class/System.Data/Test/System.Data/DataTableTest.cs

index 400fd31b5501b746a02f7f1acf53e63d67e7d2f2..8d0d0a4fd646878d90eec62427033c9f3b8973f2 100644 (file)
@@ -1,3 +1,13 @@
+2004-04-09  Atsushi Enomoto <atsushi@ximian.com>
+
+       * DataColumnTest.cs,
+         DataRowTest.cs,
+         DataTableTest.cs : build fix: csc does not allow
+         System.Type inside namespace MonoTests.System.Data.
+       * DataSetTest.cs : path fix.
+       * DataRelationTest.cs : path fix. Don't test error message: It should
+         vary by message translations. Split tests and use ExpectedException.
+
 2004-03-31  Juraj Skripsky <juraj@hotfeet.ch>
 
        * DataColumnTest.cs : fixes here and there,
index 7a4d65d80fa1858fab48c16673402c1ce9633c73..c45c6432adcc64c27c748ea0a27c92de272bc4fa 100644 (file)
@@ -532,7 +532,7 @@ namespace MonoTests.System.Data
                 public void AdditionToConstraintCollectionTest()
                 {
                         DataTable myTable = new DataTable("myTable");
-                        DataColumn idCol = new DataColumn("id",System.Type.GetType("System.Int32"));                        //set the unique property and add them to the table
+                        DataColumn idCol = new DataColumn("id",Type.GetType("System.Int32"));                        //set the unique property and add them to the table
                         idCol.Unique=true;
                         myTable.Columns.Add(idCol);
                         ConstraintCollection cc = myTable.Constraints;
index ac19a756b739bf46538aad9bfff1faf495f40446..4d9479565fa78a2b09fb06ee06977cab622bbcdb 100644 (file)
@@ -113,30 +113,24 @@ namespace MonoTests.System.Data
                 }\r
 \r
                [Test]\r
+               [ExpectedException (typeof(InvalidConstraintException))]\r
                public void InvalidConstraintException ()\r
                {\r
-                       \r
-                       DataRelation Relation = null;\r
-                       try {\r
-                               Relation = new DataRelation ("Rel", Mom.Columns [1], Child.Columns [1], true);\r
-                               Fail ("test#01");\r
-                       } catch (Exception e) {\r
-                               AssertEquals ("test#02", typeof (InvalidConstraintException), e.GetType ());\r
-                               AssertEquals ("test#03", "Parent Columns and Child Columns don't have type-matching columns.", e.Message);\r
-                       }\r
-                       \r
+                       // Parent Columns and Child Columns don't have type-matching columns.\r
+                       DataRelation Relation = new DataRelation ("Rel", Mom.Columns [1], Child.Columns [1], true);\r
+               }\r
+\r
+               [Test]\r
+               [ExpectedException (typeof(InvalidConstraintException))]\r
+               public void InvalidConstraintException2 ()\r
+               {\r
+                       // Parent Columns and Child Columns don't have type-matching columns.\r
                        Child.Columns [1].DataType = Mom.Columns [1].DataType;\r
                        \r
-                       Relation = new DataRelation ("Rel", Mom.Columns [1], Child.Columns [1], true);\r
+                       DataRelation Relation = new DataRelation ("Rel", Mom.Columns [1], Child.Columns [1], true);\r
                        Set.Relations.Add (Relation);\r
                        \r
-                       try {\r
-                               Child.Columns [1].DataType = Type.GetType ("System.Double");\r
-                               Fail ("test#04");\r
-                       } catch (Exception e) {\r
-                               AssertEquals ("test#05", typeof (InvalidConstraintException), e.GetType ());\r
-                               AssertEquals ("test#06", "Parent Columns and Child Columns don't have type-matching columns.", e.Message);\r
-                       }                                                                       \r
+                       Child.Columns [1].DataType = Type.GetType ("System.Double");\r
                }\r
                \r
                [Test]\r
@@ -373,7 +367,7 @@ namespace MonoTests.System.Data
                public void RelationFromSchema ()\r
                {\r
                        DataSet Set = new DataSet ();\r
-                       Set.ReadXmlSchema ("System.Data/store.xsd");\r
+                       Set.ReadXmlSchema ("Test/System.Data/store.xsd");\r
                        DataTable Table = Set.Tables [0];\r
                        \r
                        AssertEquals ("test#01", false, Table.CaseSensitive);\r
index 75ba0803329663d2e35038bfa865d200ef835c9b..40ea41b87c1ffb0b811e6e4183822cdb59de7af7 100644 (file)
@@ -40,20 +40,20 @@ namespace MonoTests.System.Data
                         DataColumn idColumn = new  DataColumn ();
                                                                                                     
                                                                                                     
-                        idColumn.DataType = System.Type.GetType ("System.Int32");
+                        idColumn.DataType = Type.GetType ("System.Int32");
                         idColumn.ColumnName = "Id";
                         idColumn.AutoIncrement = true;
                         namesTable.Columns.Add (idColumn);
                                                                                                     
                                                                                                     
                         DataColumn fNameColumn = new DataColumn ();
-                        fNameColumn.DataType = System.Type.GetType ("System.String");
+                        fNameColumn.DataType = Type.GetType ("System.String");
                         fNameColumn.ColumnName = "Fname";
                         fNameColumn.DefaultValue = "Fname";
                         namesTable.Columns.Add (fNameColumn);
                                                                                                     
                         DataColumn lNameColumn = new DataColumn ();
-                        lNameColumn.DataType = System.Type.GetType ("System.String");
+                        lNameColumn.DataType = Type.GetType ("System.String");
                         lNameColumn.ColumnName = "LName";
                         lNameColumn.DefaultValue="LName";
                         namesTable.Columns.Add (lNameColumn);
@@ -288,14 +288,14 @@ namespace MonoTests.System.Data
                         DataRow rowC;
                                                                                                     
                         colC = new DataColumn ();
-                        colC.DataType = System.Type.GetType ("System.Int32");
+                        colC.DataType = Type.GetType ("System.Int32");
                         colC.ColumnName = "Id";
                         colC.AutoIncrement=true;
                         tableC.Columns.Add (colC);
                                                                                                     
                                                                                                     
                         colC = new DataColumn ();
-                        colC.DataType = System.Type.GetType ("System.String");
+                        colC.DataType = Type.GetType ("System.String");
                         colC.ColumnName = "Name";
                         tableC.Columns.Add (colC);
                                                                                                     
index c200ef70abc508abac154001b5029b22cede3003..c56c756abb340a753259d3ee45e55e606c5b8ea0 100644 (file)
@@ -33,7 +33,7 @@ namespace MonoTests.System.Data
                public void ReadXmlSchema ()\r
                {\r
                        DataSet ds = new DataSet ();\r
-                       ds.ReadXmlSchema ("System.Data/own_schema.xsd");\r
+                       ds.ReadXmlSchema ("Test/System.Data/own_schema.xsd");\r
                        \r
                        AssertEquals ("test#01", 2, ds.Tables.Count);\r
                        DataTable Table = ds.Tables [0];\r
index 81314b105e0e54c39197ae2f508155a2dd7de470..127b349b172e1c6da33b244fc8b23168734ad8db 100644 (file)
@@ -758,7 +758,7 @@ namespace MonoTests.System.Data
 
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                        UniqueConstraint uc = new UniqueConstraint ("UK1", table.Columns[0] );
                        table.Constraints.Add (uc);
@@ -766,16 +766,16 @@ namespace MonoTests.System.Data
                                                                                                                            
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);
                        
                        col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table1.Columns.Add (col);
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table1.Columns.Add (col);
 
                        DataRelation dr = new DataRelation ("DR", table.Columns[0], table1.Columns[0]);
@@ -824,12 +824,12 @@ namespace MonoTests.System.Data
 
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                                                                                                                              
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);
                        
                        DataRow row = table.NewRow ();
@@ -858,24 +858,24 @@ namespace MonoTests.System.Data
 
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                        UniqueConstraint uc = new UniqueConstraint ("UK1", table.Columns[0] );
                        table.Constraints.Add (uc);
                 
                        col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table1.Columns.Add (col);
                                                                                                                              
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);
                        
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table1.Columns.Add (col);
                        DataRow row = table.NewRow ();
                        row ["Id"] = 147;
@@ -957,7 +957,7 @@ namespace MonoTests.System.Data
                        DataTable table = new DataTable ();
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        col.DefaultValue = 47;
                        table.Columns.Add (col);
                        UniqueConstraint uc = new UniqueConstraint ("UK1", table.Columns[0] );
@@ -965,7 +965,7 @@ namespace MonoTests.System.Data
                 
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        col.DefaultValue = "Hello";
                        table.Columns.Add (col);
                 
@@ -998,14 +998,14 @@ namespace MonoTests.System.Data
 
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                        UniqueConstraint uc = new UniqueConstraint ("UK1", table.Columns[0] );
                        table.Constraints.Add (uc);
                                                                                                                              
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);                        
 
                        DataRow row = table.NewRow ();
@@ -1052,12 +1052,12 @@ namespace MonoTests.System.Data
                        DataTable table = new DataTable ();
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                         
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);
                         
                        DataRow row = table.NewRow ();
@@ -1093,7 +1093,7 @@ namespace MonoTests.System.Data
                 
                        DataColumn col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table.Columns.Add (col);
                        UniqueConstraint uc = new UniqueConstraint ("UK1", table.Columns[0] );
                        table.Constraints.Add (uc);
@@ -1101,17 +1101,17 @@ namespace MonoTests.System.Data
                 
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table.Columns.Add (col);
                 
                        col = new DataColumn ();
                        col.ColumnName = "Id";
-                       col.DataType = System.Type.GetType ("System.Int32");
+                       col.DataType = Type.GetType ("System.Int32");
                        table1.Columns.Add (col);
                 
                        col = new DataColumn ();
                        col.ColumnName = "Name";
-                       col.DataType = System.Type.GetType ("System.String");
+                       col.DataType = Type.GetType ("System.String");
                        table1.Columns.Add (col);
 
                        DataRelation dr = new DataRelation ("DR", table.Columns[0], table1.Columns[0]);