public void CompareTo() { SqlDouble test1 = new SqlDouble(4e64); SqlDouble test11 = new SqlDouble(4e64); SqlDouble test2 = new SqlDouble(-9e34); SqlDouble test3 = new SqlDouble(10000); SqlString testString = new SqlString("This is a test"); Assert.True(test1.CompareTo(test3) > 0); Assert.True(test2.CompareTo(test3) < 0); Assert.True(test1.CompareTo(test11) == 0); Assert.True(test11.CompareTo(SqlDouble.Null) > 0); Assert.Throws <ArgumentException>(() => test1.CompareTo(testString)); }
public void CompareTo() { SqlDouble Test1 = new SqlDouble(4e64); SqlDouble Test11 = new SqlDouble(4e64); SqlDouble Test2 = new SqlDouble(-9e34); SqlDouble Test3 = new SqlDouble(10000); SqlString TestString = new SqlString("This is a test"); Assert.IsTrue(Test1.CompareTo(Test3) > 0, "#E01"); Assert.IsTrue(Test2.CompareTo(Test3) < 0, "#E02"); Assert.IsTrue(Test1.CompareTo(Test11) == 0, "#E03"); Assert.IsTrue(Test11.CompareTo(SqlDouble.Null) > 0, "#E04"); try { Test1.CompareTo(TestString); Assert.Fail("#E05"); } catch (ArgumentException e) { Assert.AreEqual(typeof(ArgumentException), e.GetType(), "#E06"); } }
public void CompareTo() { SqlDouble Test1 = new SqlDouble(4e64); SqlDouble Test11 = new SqlDouble(4e64); SqlDouble Test2 = new SqlDouble(-9e34); SqlDouble Test3 = new SqlDouble(10000); SqlString TestString = new SqlString("This is a test"); Assert.True(Test1.CompareTo(Test3) > 0); Assert.True(Test2.CompareTo(Test3) < 0); Assert.True(Test1.CompareTo(Test11) == 0); Assert.True(Test11.CompareTo(SqlDouble.Null) > 0); try { Test1.CompareTo(TestString); Assert.False(true); } catch (ArgumentException e) { Assert.Equal(typeof(ArgumentException), e.GetType()); } }