public void HyperGraph_GetAdjacentEdges_has_to_work() { HyperGraph hyperGraph = new HyperGraph(); Vertex v1 = hyperGraph.AddVertex("00"); Vertex v2 = hyperGraph.AddVertex("01"); Vertex v3 = hyperGraph.AddVertex("10"); HyperEdge h1 = hyperGraph.AddEdge("00", "00", "00"); HyperEdge h2 = hyperGraph.AddEdge("00", "01", "10"); HyperEdge h3 = hyperGraph.AddEdge("00", "00"); HyperEdge h4 = hyperGraph.AddEdge("01", "10"); List <HyperEdge> neighbors = hyperGraph.GetAdjacentEdges(v1).ToList(); Assert.AreEqual(3, neighbors.Count); Assert.IsTrue(neighbors.Contains(h1)); Assert.IsTrue(neighbors.Contains(h2)); Assert.IsTrue(neighbors.Contains(h3)); neighbors = hyperGraph.GetAdjacentEdges(v2).ToList(); Assert.AreEqual(2, neighbors.Count); Assert.IsTrue(neighbors.Contains(h2)); Assert.IsTrue(neighbors.Contains(h4)); neighbors = hyperGraph.GetAdjacentEdges(v2, 2).ToList(); Assert.AreEqual(1, neighbors.Count); Assert.IsTrue(neighbors.Contains(h4)); neighbors = hyperGraph.GetAdjacentEdges(v2, 3).ToList(); Assert.AreEqual(1, neighbors.Count); Assert.IsTrue(neighbors.Contains(h2)); }