Exemplo n.º 1
0
        public void AppendEdge()
        {
            var p = new DefaultMutablePath <TestVertex, TestEdge>();

            p.AppendEdge(new TestEdge(A, B));
            p.AppendEdge(new TestEdge(B, C));
            ValidatePath(p, A, C, 2);
        }
Exemplo n.º 2
0
        public void ToImmutable()
        {
            var p = new DefaultMutablePath <TestVertex, TestEdge>();

            p.AppendEdge(new TestEdge(A, B));
            p.AppendEdge(new TestEdge(B, C));
            ValidatePath(p, A, C, 2);

            // Immutables should equal.
            Assert.Equal(p.ToImmutable(), p.ToImmutable());
            ValidatePath(p.ToImmutable(), A, C, 2);
        }
Exemplo n.º 3
0
        public void RemoveEdge()
        {
            var p = new DefaultMutablePath <TestVertex, TestEdge>();

            p.AppendEdge(new TestEdge(A, B));
            p.AppendEdge(new TestEdge(B, C));
            p.AppendEdge(new TestEdge(C, C));
            p.AppendEdge(new TestEdge(C, D));
            ValidatePath(p, A, D, 4);

            p.RemoveEdge(new TestEdge(A, B));
            ValidatePath(p, B, D, 3);

            p.RemoveEdge(new TestEdge(C, C));
            ValidatePath(p, B, D, 2);

            p.RemoveEdge(new TestEdge(C, D));
            ValidatePath(p, B, C, 1);
        }