Beispiel #1
0
        public void VertexPositionChanged_Test()
        {
            var graph = new Model.GraphArea();

            var vertex = new DataVertex();

            var vctrol = new VertexControl(vertex);

            graph.Graph.AddVertex(vertex);

            graph.AddVertex(vertex, vctrol);

            bool called     = false;
            bool undoCalled = false;

            var vpco = new VertexPositionChangeOperation(graph, vctrol, 10, 10, vertex, (v, vc) =>
            {
                called = true;
            }, (vc) =>
            {
                undoCalled = true;
            });

            vpco.Do();

            Assert.IsTrue(called);

            vpco.UnDo();

            Assert.IsTrue(undoCalled);
        }
        public void VertexPositionChanged_Test()
        {
            var graph = new Model.GraphArea();

            var vertex = new DataVertex();

            var vctrol = new VertexControl(vertex);

            graph.Graph.AddVertex(vertex);

            graph.AddVertex(vertex, vctrol);

            bool called = false;
            bool undoCalled = false;

            var vpco = new VertexPositionChangeOperation(graph, vctrol, 10, 10, vertex, (v, vc) =>
            {
                called = true;
            }, (vc) =>
            {
                undoCalled = true;
            });

            vpco.Do();

            Assert.IsTrue(called);

            vpco.UnDo();

            Assert.IsTrue(undoCalled);
        }