public void EqualsTest_WhenTwoDifferentMatricesAreCompared_ThenResultIsFalse() { Matrix44D first = new Matrix44D(1.1, 1.2, 1.3, 1.4, 2.1, 2.2, 2.3, 2.4, 3.1, 3.2, 3.3, 3.4, 4.1, 4.2, 4.3, 4.4); Matrix44D second = new Matrix44D(7.1, 8.2, 9.9, 1.4, 2.1, 2.2, 2.3, 2.4, 3.1, 3.2, 3.3, 3.4, 4.1, 4.2, 4.3, 4.4); Assert.False(first.Equals(second)); }
public void TestEquals() { Matrix44D m1 = new Matrix44D(rowMajor, MatrixOrder.RowMajor); Matrix44D m2 = new Matrix44D(rowMajor, MatrixOrder.RowMajor); Assert.IsTrue(m1.Equals(m1)); Assert.IsTrue(m1.Equals(m2)); for (int i = 0; i < 16; i++) { m2 = new Matrix44D(rowMajor, MatrixOrder.RowMajor); m2[i] += 0.1; Assert.IsFalse(m1.Equals(m2)); } Assert.IsFalse(m1.Equals(m1.ToString())); }