예제 #1
0
        public void CompareInvalidObject()
        {
            IComparable left = new MySqlDateTime(2000, 1, 1, 1, 1, 1, 1);

#if BASELINE
            Assert.Throws <InvalidCastException>(() => left.CompareTo(new object()));
#else
            Assert.Throws <ArgumentException>(() => left.CompareTo(new object()));
#endif
        }
예제 #2
0
        public void CompareEqual()
        {
            IComparable left  = new MySqlDateTime(2000, 1, 1, 1, 1, 1, 1);
            IComparable right = new MySqlDateTime(2000, 1, 1, 1, 1, 1, 1);

            Assert.Equal(0, left.CompareTo(right));
        }
예제 #3
0
        public void CompareMicrosecond()
        {
            IComparable left  = new MySqlDateTime(2000, 1, 1, 1, 1, 1, 1);
            IComparable right = new MySqlDateTime(2000, 1, 1, 1, 1, 1, 2);

            Assert.True(left.CompareTo(right) < 0);
            Assert.True(right.CompareTo(left) > 0);
        }