+2008-06-16 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DataViewTest2.cs DataColumnTest.cs DataSetTest2.cs
+ UniqueConstraintTest.cs DataRowCollectionTest.cs DataRowTest2.cs
+ DataColumnCollectionTest.cs DataRelationTest.cs
+ DataTableReaderTest.cs DataRowTest.cs :
+ Eliminate English imperialism. They fail on non-English .NET.
+
2008-06-16 Atsushi Enomoto <atsushi@ximian.com>
* DataTableTest3.cs : bang bang bang, close Stream before Assertion
Assert.Fail ("test#02");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#03");
- Assert.AreEqual ("Cannot remove this column, because it is part of the parent key for relationship Rel.", e.Message, "test#04");
+ // Never premise English.
+ //Assert.AreEqual ("Cannot remove this column, because it is part of the parent key for relationship Rel.", e.Message, "test#04");
}
}
Assert.Fail ("test#04");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#05");
- Assert.AreEqual ("Column '_test_' does not belong to table test_table.", e.Message, "test#06");
+ // Never premise English.
+ //Assert.AreEqual ("Column '_test_' does not belong to table test_table.", e.Message, "test#06");
}
Cols.Add ();
Assert.Fail ("test#10");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#11");
- Assert.AreEqual ("Cannot remove a column that doesn't belong to this table.", e.Message, "test#12");
+ // Never premise English.
+ //Assert.AreEqual ("Cannot remove a column that doesn't belong to this table.", e.Message, "test#12");
}
Cols.Add ();
Assert.Fail ("test#17");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#18");
- Assert.AreEqual ("Cannot find column 10.", e.Message, "test#19");
+ // Never premise English.
+ //Assert.AreEqual ("Cannot find column 10.", e.Message, "test#19");
}
}
} catch (ArgumentNullException ex) {
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
- Assert.IsNotNull (ex.Message, "#4");
+ // Never premise English.
+// Assert.IsNotNull (ex.Message, "#4");
Assert.IsNotNull (ex.ParamName, "#5");
Assert.AreEqual ("dataType", ex.ParamName, "#6");
}
Assert.Fail ("#E1");
} catch (EvaluateException e) {
Assert.AreEqual (typeof (EvaluateException), e.GetType (), "#E2");
- Assert.AreEqual ("Cannot find column [nimi].", e.Message, "#E3");
+ // Never premise English.
+ //Assert.AreEqual ("Cannot find column [nimi].", e.Message, "#E3");
}
try {
Assert.Fail ("#G1");
} catch (EvaluateException e) {
Assert.AreEqual (typeof (EvaluateException), e.GetType (), "#G2");
- Assert.AreEqual ("Invalid type name 'Boolean'.", e.Message, "#G3");
+ // Never premise English.
+ //Assert.AreEqual ("Invalid type name 'Boolean'.", e.Message, "#G3");
}
}
Fail ("test#03");\r
} catch (Exception e) {\r
AssertEquals ("test#04", typeof (ConstraintException), e.GetType ());\r
- AssertEquals ("test#05", "Column 'ChildName' is constrained to be unique. Value 'Dick' is already present.", e.Message);\r
+ // Never premise English.\r
+ //AssertEquals ("test#05", "Column 'ChildName' is constrained to be unique. Value 'Dick' is already present.", e.Message);\r
} \r
\r
Row = Mom.NewRow (); \r
Fail ("test#07"); \r
} catch (Exception e) { \r
AssertEquals ("test#08", typeof (InvalidConstraintException), e.GetType ());\r
- AssertEquals ("test#09", "ForeignKeyConstraint Rel requires the child key values (Jack) to exist in the parent table.", e.Message); \r
+ // Never premise English.\r
+ //AssertEquals ("test#09", "ForeignKeyConstraint Rel requires the child key values (Jack) to exist in the parent table.", e.Message); \r
} \r
\r
}\r
Assert.Fail ("test#13");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#14");
- Assert.AreEqual ("This row already belongs to this table.", e.Message, "test#15");
+ // Never premise English.
+ //Assert.AreEqual ("This row already belongs to this table.", e.Message, "test#15");
}
try {
Assert.Fail ("test#22");
} catch (Exception e) {
Assert.AreEqual (typeof (ConstraintException), e.GetType (), "test#23");
- Assert.AreEqual ("Column 'Column1' is constrained to be unique. Value 'first' is already present.", e.Message, "test#24");
+ // Never premise English.
+ //Assert.AreEqual ("Column 'Column1' is constrained to be unique. Value 'first' is already present.", e.Message, "test#24");
}
Column = new DataColumn ("integer");
Assert.Fail ("test#07");
} catch (Exception e) {
Assert.AreEqual (typeof (MissingPrimaryKeyException), e.GetType (), "test#08");
- Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "test#09");
+ // Never premise English.
+ //Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "test#09");
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
Assert.Fail ("test#13");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#14");
- Assert.AreEqual ("Expecting 1 value(s) for the key being indexed, but received 2 value(s).", e.Message, "test#15");
+ // Never premise English.
+ //Assert.AreEqual ("Expecting 1 value(s) for the key being indexed, but received 2 value(s).", e.Message, "test#15");
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
Assert.Fail ("test#20");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#21");
- Assert.AreEqual ("Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message, "test#22");
+ // Never premise English.
+ //Assert.AreEqual ("Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message, "test#22");
}
}
Assert.Fail ("test#01");
} catch (Exception e) {
Assert.AreEqual (typeof (MissingPrimaryKeyException), e.GetType (), "test#02");
- Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "test#03");
+ // Never premise English.
+ //Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "test#03");
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0]};
Assert.Fail ("test#11");
} catch (Exception e) {
Assert.AreEqual (typeof (MissingPrimaryKeyException), e.GetType (), "test#12");
- Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "tets#13");
+ // Never premise English.
+ //Assert.AreEqual ("Table doesn't have a primary key.", e.Message, "tets#13");
}
_tbl.PrimaryKey = new DataColumn [] {_tbl.Columns [0], _tbl.Columns [1]};
Assert.Fail ("test#14");
} catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#15");
- Assert.AreEqual ("Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message, "test#16");
+ // Never premise English.
+ //Assert.AreEqual ("Expecting 2 value(s) for the key being indexed, but received 1 value(s).", e.Message, "test#16");
}
row = Rows.Find (new object [] {1, "fir"});
Assert.Fail ("test#01");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#02");
- Assert.AreEqual ("The row insert position -1 is invalid.", e.Message, "test#03");
+ // Never premise English.
+ //Assert.AreEqual ("The row insert position -1 is invalid.", e.Message, "test#03");
}
Rows.InsertAt (Row, 0);
}
catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#09");
- Assert.AreEqual ("This row already belongs to this table.", e.Message, "test#10");
+ // Never premise English.
+ //Assert.AreEqual ("This row already belongs to this table.", e.Message, "test#10");
}
DataTable table = new DataTable ();
}
catch (Exception e) {
Assert.AreEqual (typeof (ArgumentException), e.GetType (), "test#12");
- Assert.AreEqual ("This row already belongs to another table.", e.Message, "test#13");
+ // Never premise English.
+ //Assert.AreEqual ("This row already belongs to another table.", e.Message, "test#13");
}
table = new DataTable ();
Assert.Fail ("test#06");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#07");
- Assert.AreEqual ("The given datarow is not in the current DataRowCollection.", e.Message, "test#08");
+ // Never premise English.
+ //Assert.AreEqual ("The given datarow is not in the current DataRowCollection.", e.Message, "test#08");
}
DataRow Row = new DataTable ().NewRow ();
Assert.Fail ("test#09");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#10");
- Assert.AreEqual ("The given datarow is not in the current DataRowCollection.", e.Message, "test#11");
+ // Never premise English.
+ //Assert.AreEqual ("The given datarow is not in the current DataRowCollection.", e.Message, "test#11");
}
try {
Assert.Fail ("test#12");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#13");
- Assert.AreEqual ("There is no row at position -1.", e.Message, "test#14");
+ // Never premise English.
+ //Assert.AreEqual ("There is no row at position -1.", e.Message, "test#14");
}
try {
Assert.Fail ("test#15");
} catch (Exception e) {
Assert.AreEqual (typeof (IndexOutOfRangeException), e.GetType (), "test#16");
- Assert.AreEqual ("There is no row at position 64.", e.Message, "test#17");
+ // Never premise English.
+ //Assert.AreEqual ("There is no row at position 64.", e.Message, "test#17");
}
Rows.RemoveAt (0);
Fail ("#A07");
}
catch (Exception e) {
- AssertEquals ("#A08", "There is no row at position 2.", e.Message);
+ // Never premise English.
+ //AssertEquals ("#A08", "There is no row at position 2.", e.Message);
}
}
row.SetAdded();
Assert.Fail ("#1");
} catch (InvalidOperationException e) {
- Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
}
table.Columns.Add("col1", typeof(int));
row.SetAdded();
Assert.Fail ("#2");
} catch (InvalidOperationException e) {
- Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
}
Assert.AreEqual(DataRowState.Added, row.RowState, "#2");
row.SetAdded();
Assert.Fail ("#3");
} catch (InvalidOperationException e) {
- Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
}
row.AcceptChanges();
row.SetModified();
Assert.Fail ("#1");
} catch (InvalidOperationException e) {
- Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
}
row.AcceptChanges();
row.SetModified ();
Assert.Fail ("#2");
} catch (InvalidOperationException e) {
- Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual (SetAddedModified_ErrMsg, e.Message, "#2");
}
row.AcceptChanges();
ds.EnforceConstraints = true;
Assert.Fail ("#1");
} catch (ConstraintException e) {
- Assert.AreEqual ("Failed to enable constraints. One or more rows contain values " +
- "violating non-null, unique, or foreign-key constraints.", e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual ("Failed to enable constraints. One or more rows contain values " +
+ // "violating non-null, unique, or foreign-key constraints.", e.Message, "#2");
}
}
ds.EnforceConstraints = true;
Assert.Fail ("#1");
} catch (ConstraintException e) {
- Assert.AreEqual ("Failed to enable constraints. One or more rows contain values " +
- "violating non-null, unique, or foreign-key constraints.", e.Message, "#2");
+ // Never premise English.
+ //Assert.AreEqual ("Failed to enable constraints. One or more rows contain values " +
+ // "violating non-null, unique, or foreign-key constraints.", e.Message, "#2");
}
}
rdr.GetSchemaTable ();
Assert.Fail ("#0");
} catch (InvalidOperationException e) {
- Assert.AreEqual ("Schema of current DataTable '" + table.TableName +
- "' in DataTableReader has changed, DataTableReader is invalid.", e.Message, "#1");
+ // Never premise English.
+ //Assert.AreEqual ("Schema of current DataTable '" + table.TableName +
+ // "' in DataTableReader has changed, DataTableReader is invalid.", e.Message, "#1");
}
rdr = table.CreateDataReader ();
rdr.GetSchemaTable ();
Assert.Fail ("#1");
} catch (InvalidOperationException e) {
- Assert.AreEqual ("Schema of current DataTable '" + table.TableName +
- "' in DataTableReader has changed, DataTableReader is invalid.", e.Message, "#1");
+ // Never premise English.
+ //Assert.AreEqual ("Schema of current DataTable '" + table.TableName +
+ // "' in DataTableReader has changed, DataTableReader is invalid.", e.Message, "#1");
}
}
rdr.GetChars (1, 0, null, 0, 10);
Assert.Fail ("#1");
} catch (InvalidCastException e) {
- Assert.AreEqual ("Unable to cast object of type 'System.String'" +
- " to type 'System.Char[]'.", e.Message, "#1");
+ // Never premise English.
+ //Assert.AreEqual ("Unable to cast object of type 'System.String'" +
+ // " to type 'System.Char[]'.", e.Message, "#1");
}
char[] char_arr = null;
long len = 0;
try {
DataTable newTable = view.ToTable (false, null);
} catch (ArgumentNullException e) {
- Assert.AreEqual ("'columnNames' argument cannot be null." + Environment.NewLine +
- "Parameter name: columnNames", e.Message, "#1");
+ // Never premise English.
+ //Assert.AreEqual ("'columnNames' argument cannot be null." + Environment.NewLine +
+ // "Parameter name: columnNames", e.Message, "#1");
}
DataTable newTable1 = view.ToTable(false, new string[] { });
Assert.AreEqual(10, newTable1.Rows.Count, "#3");
}
catch (Exception e) {
AssertEquals ("test#02", typeof (ArgumentException), e.GetType ());
- AssertEquals ("test#03", "Column must belong to a table.", e.Message);
+ // Never premise English.
+ // AssertEquals ("test#03", "Column must belong to a table.", e.Message);
}
//Null exception
}
catch (Exception e) {
AssertEquals ("test#05", typeof (NullReferenceException), e.GetType ());
- AssertEquals ("test#06", "Object reference not set to an instance of an object.", e.Message);
+ // Never premise English.
+ //AssertEquals ("test#06", "Object reference not set to an instance of an object.", e.Message);
}
try {