public void DuplicateVector() { Vector3 vector = Auxilaries.RandomPosition(); Vector3 actual = vector.Duplicate(); Assert.AreEqual(vector, actual); Assert.AreNotSame(vector, actual); }
public void ChangeTransformOfPosition_TransformsAreNull() { Vector3 vector = Auxilaries.RandomPosition(); Vector3 actual = vector.ChangeTransformOfPosition(null, null); Vector3 expected = vector; Assert.AreEqual(expected, actual); Assert.AreNotSame(vector, actual); }
public void XAndyAreNotEqual_ValueIncidentEdgesDifferent() { Vector3 position = Auxilaries.RandomPosition(); KeyValuePair <Vector3, Vertex> x = new KeyValuePair <Vector3, Vertex>(new Vector3(1, 2, 3), new Vertex(position)); KeyValuePair <Vector3, Vertex> y = new KeyValuePair <Vector3, Vertex>(new Vector3(1, 2, 3), new Vertex(position)); x.Value.AddIncidentEdge(Auxilaries.RandomHalfEdge()); y.Value.AddIncidentEdge(Auxilaries.RandomHalfEdge()); Assert.IsFalse(comparer.Equals(x, y)); Assert.AreNotEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void XAndyAreEqual_IncidentEdgesDifferent() { Vector3 positon = Auxilaries.RandomPosition(); Vertex x = new Vertex(positon); Vertex y = new Vertex(positon); x.AddIncidentEdge(Auxilaries.RandomHalfEdge()); y.AddIncidentEdge(Auxilaries.RandomHalfEdge()); Assert.IsTrue(comparer.Equals(x, y)); Assert.AreEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void NewellsMethodTest_OneVector() { Vector3 a = Auxilaries.RandomPosition(); Assert.Throws( typeof(System.ArgumentException), delegate { NumericalMath.NewellsMethod(new Vector3[] { a }); } ); }
public void TestEquals_IncidentEdgesNotEqual() { Vector3 position = Auxilaries.RandomPosition(); Vertex thisVertex = new Vertex(position); Vertex otherVertex = new Vertex(position); HalfEdge edge1 = Auxilaries.RandomHalfEdge(); HalfEdge edge2 = Auxilaries.RandomHalfEdge(); HalfEdge edge3 = Auxilaries.RandomHalfEdge(); thisVertex.AddIncidentEdge(edge1); thisVertex.AddIncidentEdge(edge2); otherVertex.AddIncidentEdge(edge3); Assert.IsFalse(thisVertex.Equals(otherVertex)); Assert.IsFalse(otherVertex.Equals(thisVertex)); Assert.AreNotEqual(thisVertex.GetHashCode(), otherVertex.GetHashCode()); }