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 }
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)); }
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); }