Exemplo n.º 1
0
        void TestCompareTo_ObjNotHalfedge_Helper()
        {
            HalfEdge edge   = Auxilaries.RandomHalfEdge();
            Vertex   vertex = Auxilaries.RandomVertex();

            edge.CompareTo(vertex);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public void TestCompareTo_ObjNull()
        {
            HalfEdge edge = Auxilaries.RandomHalfEdge();

            int expected = 1;
            int actual   = edge.CompareTo(null);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }