Test DateTimeOffset.Parse with format yyyy-dd-MMzzz. Covers #22558.
[mono.git] / mcs / class / corlib / Test / System / UInt16Test.cs
index 3ad64ad83b5bd2e5c6a854735bb26bad059fb95f..a0b8565e045d0d0aef818226a82e1d4774ffad0b 100644 (file)
@@ -78,16 +78,14 @@ public class UInt16Test
        [Test]
        public void TestCompareTo()
        {
-               Assert.IsTrue(MyUInt16_3.CompareTo(MyUInt16_2) > 0);
-               Assert.IsTrue(MyUInt16_2.CompareTo(MyUInt16_2) == 0);
-               Assert.IsTrue(MyUInt16_1.CompareTo((UInt16)(42)) == 0);
-               Assert.IsTrue(MyUInt16_2.CompareTo(MyUInt16_3) < 0);
+               Assert.AreEqual(65535, MyUInt16_3.CompareTo(MyUInt16_2), "#1");
+               Assert.AreEqual(0, MyUInt16_2.CompareTo(MyUInt16_2), "#2");
+               Assert.AreEqual(0, MyUInt16_1.CompareTo((UInt16)(42)), "#3");
+               Assert.AreEqual(-65535, MyUInt16_2.CompareTo(MyUInt16_3), "#4");
                try {
                        MyUInt16_2.CompareTo((object)100);
                        Assert.Fail("Should raise a System.ArgumentException");
-               }
-               catch (Exception e) {
-                       Assert.IsTrue(typeof(ArgumentException) == e.GetType());
+               } catch (ArgumentException e) {
                }
        }
 
@@ -178,6 +176,7 @@ public class UInt16Test
                Assert.AreEqual (20, UInt16.Parse ("2E1", NumberStyles.AllowExponent), "A#2");
                Assert.AreEqual (200, UInt16.Parse ("2E2", NumberStyles.AllowExponent), "A#3");
                Assert.AreEqual (200, UInt16.Parse ("2E+2", NumberStyles.AllowExponent), "A#4");
+               Assert.AreEqual (2, UInt16.Parse ("2", NumberStyles.AllowExponent), "A#5");
 
                try {
                        UInt16.Parse ("2E");