Esempio n. 1
0
        public void VertexDescriptor_RemoveEdge_NoExceptionIfListIsEmpty()
        {
            VertexDescriptor <int, string> vertexDescriptor = new VertexDescriptor <int, string>(10);

            Assert.Empty(vertexDescriptor.Edges);

            EdgeDescriptor <int, string> edgeDesciptor = new EdgeDescriptor <int, string>(20, 30, "edge");

            vertexDescriptor.RemoveEdge(edgeDesciptor);

            Assert.Empty(vertexDescriptor.Edges);
        }
Esempio n. 2
0
        public void VertexDescriptor_RemoveEdge_RemovesEdgeFromVertex()
        {
            int vertex1 = 10;
            int vertex2 = 20;
            VertexDescriptor <int, string> vertexDescriptor = new VertexDescriptor <int, string>(vertex1);
            EdgeDescriptor <int, string>   edgeDesciptor    = new EdgeDescriptor <int, string>(vertex1, vertex2, "edge");

            vertexDescriptor.AddEdge(edgeDesciptor);

            Assert.Contains(edgeDesciptor, vertexDescriptor.Edges);

            vertexDescriptor.RemoveEdge(edgeDesciptor);
            Assert.DoesNotContain(edgeDesciptor, vertexDescriptor.Edges);
        }