public void CompareTo() { SqlString TestString = new SqlString("This is a test"); Assert.True(_test1.CompareTo(_test3) < 0); Assert.True(_test2.CompareTo(_test1) > 0); Assert.Equal(0, _test2.CompareTo(_test3)); Assert.True(_test4.CompareTo(SqlDecimal.Null) > 0); Assert.Throws <ArgumentException>(() => _test1.CompareTo(TestString)); }
public void CompareTo() { SqlString TestString = new SqlString("This is a test"); Assert.IsTrue(Test1.CompareTo(Test3) < 0, "#G01"); Assert.IsTrue(Test2.CompareTo(Test1) > 0, "#G02"); Assert.IsTrue(Test2.CompareTo(Test3) == 0, "#G03"); Assert.IsTrue(Test4.CompareTo(SqlDecimal.Null) > 0, "#G04"); try { Test1.CompareTo(TestString); Assert.Fail("#G05"); } catch (ArgumentException e) { Assert.AreEqual(typeof(ArgumentException), e.GetType(), "#G06"); } }
public void CompareTo() { SqlString TestString = new SqlString("This is a test"); Assert.True(_test1.CompareTo(_test3) < 0); Assert.True(_test2.CompareTo(_test1) > 0); Assert.True(_test2.CompareTo(_test3) == 0); Assert.True(_test4.CompareTo(SqlDecimal.Null) > 0); try { _test1.CompareTo(TestString); Assert.False(true); } catch (ArgumentException e) { Assert.Equal(typeof(ArgumentException), e.GetType()); } }