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 TestEquals_IdxEqualNotEqualSameSizeDifferentEdges() { HalfEdge a = Auxilaries.RandomHalfEdge(); HalfEdge b = Auxilaries.RandomHalfEdge(); HalfEdge c = Auxilaries.RandomHalfEdge(); HalfEdge d = Auxilaries.RandomHalfEdge(); HalfEdge e = Auxilaries.RandomHalfEdge(); Vector3 normal = Auxilaries.RandomNormal(); Face thisFace = new Face(0, normal); thisFace.AddOuterComponent(a); thisFace.AddOuterComponent(b); thisFace.AddOuterComponent(c); thisFace.AddOuterComponent(d); Face otherFace = new Face(0, normal); otherFace.AddOuterComponent(a); otherFace.AddOuterComponent(b); otherFace.AddOuterComponent(e); otherFace.AddOuterComponent(d); Assert.IsFalse(thisFace.Equals(otherFace)); Assert.IsFalse(otherFace.Equals(thisFace)); Assert.AreNotEqual(thisFace.GetHashCode(), otherFace.GetHashCode()); }
void TestCompareTo_ObjNotFace_Helper() { Face face = Auxilaries.RandomFace(); HalfEdge edge = Auxilaries.RandomHalfEdge(); face.CompareTo(edge); }
public void TestEquals_EqualsDifferentOrder() { HalfEdge a = Auxilaries.RandomHalfEdge(); HalfEdge b = Auxilaries.RandomHalfEdge(); HalfEdge c = Auxilaries.RandomHalfEdge(); HalfEdge d = Auxilaries.RandomHalfEdge(); Vector3 normal = Auxilaries.RandomNormal(); Face thisFace = new Face(0, normal); thisFace.AddOuterComponent(a); thisFace.AddOuterComponent(b); thisFace.AddOuterComponent(c); thisFace.AddOuterComponent(d); Face otherFace = new Face(0, normal); otherFace.AddOuterComponent(b); otherFace.AddOuterComponent(a); otherFace.AddOuterComponent(d); otherFace.AddOuterComponent(c); Assert.IsTrue(thisFace.Equals(otherFace)); Assert.IsTrue(otherFace.Equals(thisFace)); Assert.AreEqual(thisFace.GetHashCode(), otherFace.GetHashCode()); }
void TestCompareTo_ObjNotVertex_Helper() { Vertex vertex = Auxilaries.RandomVertex(); HalfEdge edge = Auxilaries.RandomHalfEdge(); vertex.CompareTo(edge); }
public void XAndyAreNotEqual_OriginDifferent() { HalfEdge x = Auxilaries.RandomHalfEdge(); HalfEdge y = Auxilaries.RandomHalfEdge(); Assert.IsFalse(comparer.Equals(x, y)); Assert.AreNotEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void TestHasIncidentFace_HasIncidentFace() { HalfEdge edge = Auxilaries.RandomHalfEdge(); edge.IncidentFace = new Face(0, Auxilaries.RandomNormal()); Assert.IsTrue(edge.HasIncidentFace); }
public void YIsNull() { HalfEdge x = Auxilaries.RandomHalfEdge(); HalfEdge y = null; Assert.IsFalse(comparer.Equals(x, y)); Assert.AreNotEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void TestHasDestination_HasDestination() { HalfEdge edge = Auxilaries.RandomHalfEdge(); HalfEdge twin = Auxilaries.RandomHalfEdge(); edge.Twin = twin; Assert.IsTrue(edge.HasDestination); }
public void TestHasNext_HasNext() { HalfEdge edge = Auxilaries.RandomHalfEdge(); HalfEdge next = Auxilaries.RandomHalfEdge(); edge.Next = next; Assert.IsTrue(edge.HasNext); }
public void TestHasPrevious_HasPrevious() { HalfEdge edge = Auxilaries.RandomHalfEdge(); HalfEdge previous = Auxilaries.RandomHalfEdge(); edge.Previous = previous; Assert.IsTrue(edge.HasPrevious); }
public void TestCompareTo_ObjNull() { HalfEdge edge = Auxilaries.RandomHalfEdge(); int expected = 1; int actual = edge.CompareTo(null); Assert.AreEqual(expected, actual); }
public void TestEquals_NotEqualOriginDifferent() { HalfEdge thisEdge = Auxilaries.RandomHalfEdge(); HalfEdge otherEdge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(thisEdge.Equals(otherEdge)); Assert.IsFalse(otherEdge.Equals(thisEdge)); Assert.AreNotEqual(thisEdge.GetHashCode(), otherEdge.GetHashCode()); }
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 XAndyAreNotEqual_OuterComponentsDifferent() { int idx = 3; Vector3 normal = Auxilaries.RandomNormal(); Face x = new Face(idx, normal); Face y = new Face(idx, normal); x.AddOuterComponent(Auxilaries.RandomHalfEdge()); y.AddOuterComponent(Auxilaries.RandomHalfEdge()); Assert.IsTrue(comparer.Equals(x, y)); Assert.AreEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void XAndyAreNotEqual_DestinationDifferent() { Vertex origin = Auxilaries.RandomVertex(); HalfEdge x = new HalfEdge(origin); HalfEdge y = new HalfEdge(origin); x.Twin = Auxilaries.RandomHalfEdge(); y.Twin = Auxilaries.RandomHalfEdge(); Assert.IsFalse(comparer.Equals(x, y)); Assert.AreNotEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void XAndyAreEqual_PreviousDifferent() { Vertex origin = Auxilaries.RandomVertex(); Vertex destination = Auxilaries.RandomVertex(); HalfEdge x = new HalfEdge(origin); HalfEdge y = new HalfEdge(origin); x.Twin = new HalfEdge(destination); y.Twin = new HalfEdge(destination); x.Previous = Auxilaries.RandomHalfEdge(); y.Previous = Auxilaries.RandomHalfEdge(); Assert.IsTrue(comparer.Equals(x, y)); Assert.AreEqual(comparer.GetHashCode(x), comparer.GetHashCode(y)); }
public void TestEquals_NotEqualDifferentNormals() { HalfEdge a = Auxilaries.RandomHalfEdge(); HalfEdge b = Auxilaries.RandomHalfEdge(); Face thisFace = new Face(0, Auxilaries.RandomNormal()); thisFace.AddOuterComponent(a); thisFace.AddOuterComponent(b); Face otherFace = new Face(0, Auxilaries.RandomNormal()); thisFace.AddOuterComponent(a); thisFace.AddOuterComponent(b); Assert.IsFalse(thisFace.Equals(otherFace)); Assert.IsFalse(otherFace.Equals(thisFace)); Assert.AreNotEqual(thisFace.GetHashCode(), otherFace.GetHashCode()); }
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()); }
public void TestCompareTo_ObjEqualInPositionLargerInNextTwinSet() { 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(3, 4, 5))); otherEdge.Next = new HalfEdge(new Vertex(new Vector3(0, 1, 2))); int expected = +1; int actual = thisEdge.CompareTo(otherEdge); Assert.AreEqual(expected, actual); }
public void TestHasIncidentFace_HasNoIncidentFace() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(edge.HasDestination); }
public void TestHasTwin_HasNoTwin() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(edge.HasTwin); }
public void TestHasPrevious_HasNoPrevious() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(edge.HasPrevious); }
public void TestHasNext_HasNoNext() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(edge.HasNext); }
public void TestHasDestination_HasNoDestination() { HalfEdge edge = Auxilaries.RandomHalfEdge(); Assert.IsFalse(edge.HasDestination); }