public void TestCompareTo() { ObjectMatrix <int> matrix1 = GetTestMatrix(); ObjectMatrix <int> matrix2 = new ObjectMatrix <int>(4, 5); Assert.AreEqual(matrix1.CompareTo(matrix2), 1); Assert.AreEqual(matrix2.CompareTo(matrix1), -1); Assert.AreEqual(matrix1.CompareTo(matrix1), 0); Assert.AreEqual(matrix2.CompareTo(matrix2), 0); Assert.AreEqual(matrix2.CompareTo(new Object()), -1); }
public void TestNullCompareTo() { ObjectMatrix <int> matrix = GetTestMatrix(); matrix.CompareTo(null); }