void TestCompareTo_ObjNotHalfedge_Helper() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Vertex vertex = Auxilaries.RandomVertex(); edge.CompareTo(vertex); }
public void TestCompareTo_ObjEqualInEverything() { Vertex vertex = Auxilaries.RandomVertex(); HalfEdge thisEdge = new HalfEdge(vertex); HalfEdge otherEdge = new HalfEdge(vertex); HalfEdge twin = Auxilaries.RandomHalfEdge(); thisEdge.Twin = twin; otherEdge.Twin = twin; HalfEdge next = Auxilaries.RandomHalfEdge(); thisEdge.Next = next; otherEdge.Next = next; HalfEdge previous = Auxilaries.RandomHalfEdge(); thisEdge.Previous = previous; otherEdge.Previous = previous; int expected = 0; int actual = thisEdge.CompareTo(otherEdge); Assert.AreEqual(expected, actual); }
public void TestCompareTo_ObjNull() { HalfEdge edge = Auxilaries.RandomHalfEdge(); int expected = 1; int actual = edge.CompareTo(null); Assert.AreEqual(expected, actual); }
public void TestCompareTo_ObjLargerInPosition() { HalfEdge thisHalfEdge = new HalfEdge(new Vertex(new Vector3(3, 4, 5))); HalfEdge otherHalfEdge = new HalfEdge(new Vertex(new Vector3(0, 1, 2))); int expected = 1; int actual = thisHalfEdge.CompareTo(otherHalfEdge); Assert.AreEqual(expected, actual); }
public void TestCompareTo_ObjEqualInPositionEverythingElseNull() { Vertex vertex = Auxilaries.RandomVertex(); HalfEdge thisHalfEdge = new HalfEdge(vertex); HalfEdge otherHalfEdge = new HalfEdge(vertex); int expected = 0; int actual = thisHalfEdge.CompareTo(otherHalfEdge); Assert.AreEqual(expected, actual); }
public void TestCompareTo_ObjEqualInPositionLargerInPrevious() { Vertex vertex = Auxilaries.RandomVertex(); HalfEdge thisEdge = new HalfEdge(vertex); HalfEdge otherEdge = new HalfEdge(vertex); thisEdge.Previous = new HalfEdge(new Vertex(new Vector3(3, 4, 5))); otherEdge.Previous = new HalfEdge(new Vertex(new Vector3(0, 1, 2))); int expected = +1; int actual = thisEdge.CompareTo(otherEdge); Assert.AreEqual(expected, actual); }
public void TestCompareTo_ObjEqualInPositionSmallerInNextTwinSet() { Vertex vertex = Auxilaries.RandomVertex(); HalfEdge thisEdge = new HalfEdge(vertex); HalfEdge otherEdge = new HalfEdge(vertex); HalfEdge twin = Auxilaries.RandomHalfEdge(); thisEdge.Twin = twin; otherEdge.Twin = twin; thisEdge.Next = new HalfEdge(new Vertex(new Vector3(0, 1, 2))); otherEdge.Next = new HalfEdge(new Vertex(new Vector3(3, 4, 5))); int expected = -1; int actual = thisEdge.CompareTo(otherEdge); Assert.AreEqual(expected, actual); }