public void EqualsTest() { VectorD v0 = new VectorD(new[] { 678.0, 234.8, -123.987, 4.0 }); VectorD v1 = new VectorD(new[] { 678.0, 234.8, -123.987, 4.0 }); VectorD v2 = new VectorD(new[] { 67.0, 234.8, -123.987, 4.0 }); VectorD v3 = new VectorD(new[] { 678.0, 24.8, -123.987, 4.0 }); VectorD v4 = new VectorD(new[] { 678.0, 234.8, 123.987, 4.0 }); VectorD v5 = new VectorD(new[] { 678.0, 234.8, 123.987, 4.1 }); VectorD v6 = new VectorD(new[] { 678.0, 234.8, -123.987 }); Assert.IsTrue(v0.Equals(v0)); Assert.IsTrue(v0.Equals(v1)); Assert.IsFalse(v0.Equals(v2)); Assert.IsFalse(v0.Equals(v3)); Assert.IsFalse(v0.Equals(v4)); Assert.IsFalse(v0.Equals(v5)); Assert.IsFalse(v0.Equals(v0.ToString())); Assert.IsFalse(v0.Equals(v6)); }
public void ToStringTest() { VectorD v1 = new VectorD(new List<double>(new double[] { 1, 2, 3, 4, 5 })); VectorD v2 = new VectorD(new List<double>(new double[] { 1, 2, 3, 4, 6 })); Assert.IsFalse(String.IsNullOrEmpty(v1.ToString())); Assert.AreNotEqual(v1.ToString(), v2.ToString()); }