+2001-11-28 Nick Drochak <ndrochak@gol.com>\r
+\r
+ * Int16Test.cs Int32Test.cs SByteTest.cs: Surgically removed tests that rely on culture of system. These need to be crafted a bit differently.\r
+\r
2001-11-27 Nick Drochak <ndrochak@gol.com>\r
\r
* SByteTest.cs: Add messages to Assert()'s so we can tell where the tests fail.\r
Assert(String.Compare(MyString2, MyInt16_2.ToString()) == 0);
Assert(String.Compare(MyString3, MyInt16_3.ToString()) == 0);
//test ToString(string format)
+ /*
+ TODO: These tests are culture sensitive. Need to find a way to determine the culture
+ of the system to decide the correct expected result.
for (int i=0; i < Formats1.Length; i++) {
Assert(String.Compare(Results1[i], MyInt16_2.ToString(Formats1[i])) == 0);
Assert(String.Compare(Results2[i], MyInt16_3.ToString(Formats2[i])) == 0);
}
+ */
//test ToString(string format, IFormatProvider provider);
for (int i=0; i < Formats1.Length; i++) {
- Assert(String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
- Assert(String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
+ Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MyInt16_2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MyInt16_2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MyInt16_2.ToString(Formats1[i], Nfi)) == 0);
+ Assert("i="+i+", ResultsNfi2[i]="+ResultsNfi2[i]+", MyInt16_3.ToString(Formats2[i]="+Formats2[i]+"): Expected "+ResultsNfi2[i]+" but got "+MyInt16_3.ToString(Formats2[i], Nfi), String.Compare(ResultsNfi2[i], MyInt16_3.ToString(Formats2[i], Nfi)) == 0);
}
try {
MyInt16_1.ToString("z");
public void TestCompareTo()
{
- Assert(MyInt32_3.CompareTo(MyInt32_2) > 0);
- Assert(MyInt32_2.CompareTo(MyInt32_2) == 0);
- Assert(MyInt32_1.CompareTo((Int32)(-42)) == 0);
- Assert(MyInt32_2.CompareTo(MyInt32_3) < 0);
+ Assert("MyInt32_3.CompareTo(MyInt32_2) > 0", MyInt32_3.CompareTo(MyInt32_2) > 0);
+ Assert("MyInt32_2.CompareTo(MyInt32_2) == 0", MyInt32_2.CompareTo(MyInt32_2) == 0);
+ Assert("MyInt32_1.CompareTo((Int32)(-42)) == 0", MyInt32_1.CompareTo((Int32)(-42)) == 0);
+ Assert("MyInt32_2.CompareTo(MyInt32_3) < 0", MyInt32_2.CompareTo(MyInt32_3) < 0);
try {
MyInt32_2.CompareTo((Int16)100);
Fail("Should raise a System.ArgumentException");
}
catch (Exception e) {
- Assert(typeof(ArgumentException) == e.GetType());
+ Assert("typeof(ArgumentException) == e.GetType()", typeof(ArgumentException) == e.GetType());
}
}
Assert(String.Compare(MyString2, MyInt32_2.ToString()) == 0);
Assert(String.Compare(MyString3, MyInt32_3.ToString()) == 0);
//test ToString(string format)
+ /*
+ TODO: These tests are culture sensitive. Need to find a way to determine the culture
+ of the system to decide the correct expected result.
for (int i=0; i < Formats1.Length; i++) {
Assert(String.Compare(Results1[i], MyInt32_2.ToString(Formats1[i])) == 0);
Assert(String.Compare(Results2[i], MyInt32_3.ToString(Formats2[i])) == 0);
}
+ */
//test ToString(string format, IFormatProvider provider);
for (int i=0; i < Formats1.Length; i++) {
Assert(String.Compare(ResultsNfi1[i], MyInt32_2.ToString(Formats1[i], Nfi)) == 0);
Assert("MyString2, MySByte2.ToString()", String.Compare(MyString2, MySByte2.ToString()) == 0);
Assert("MyString3, MySByte3.ToString()", String.Compare(MyString3, MySByte3.ToString()) == 0);
//test ToString(string format)
+ /*
+ TODO: These tests depend on the culture of the system running the test.
+ So, this needs to be tested in a different way.
for (int i=0; i < Formats1.Length; i++) {
- Assert("Results1[i], MySByte2.ToString(Formats1[i])", String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
+ Assert("i="+i+", Results1[i]="+Results1[i]+", MySByte2.ToString(Formats1[i])="+MySByte2.ToString(Formats1[i]), String.Compare(Results1[i], MySByte2.ToString(Formats1[i])) == 0);
Assert("Results2[i], MySByte3.ToString(Formats2[i])", String.Compare(Results2[i], MySByte3.ToString(Formats2[i])) == 0);
}
+ */
//test ToString(string format, IFormatProvider provider);
for (int i=0; i < Formats1.Length; i++) {
Assert("i="+i+", ResultsNfi1[i]="+ResultsNfi1[i]+", MySByte2.ToString(Formats1[i]="+Formats1[i]+"): Expected "+ResultsNfi1[i]+" but got "+MySByte2.ToString(Formats1[i], Nfi), String.Compare(ResultsNfi1[i], MySByte2.ToString(Formats1[i], Nfi)) == 0);