Beispiel #1
0
        public void CopyDiagram()
        {
            var copier      = new DiagramCopier(ProjectManager);
            var diagramCopy = copier.Copy(SelectedDiagram);

            ProjectManager.CreateDiagram(diagramCopy);
        }
Beispiel #2
0
        public void TestCopy_CopyEmptyDiagram_NameContainsCopiedName()
        {
            var projectManagerMoq = new Mock <IProjectManager>();
            var copier            = new DiagramCopier(projectManagerMoq.Object);
            var diagram           = new DiagramModel
            {
                Name = "d"
            };
            var copiedDiagram = copier.Copy(diagram);

            Assert.IsTrue(copiedDiagram.Name.Contains(diagram.Name));
        }
Beispiel #3
0
        public void TestCopy_CopyEmptyDiagram_CopiedDiagramIsDifferent()
        {
            var projectManagerMoq = new Mock <IProjectManager>();
            var copier            = new DiagramCopier(projectManagerMoq.Object);
            var diagram           = new DiagramModel
            {
                Name = "d"
            };
            var copiedDiagram = copier.Copy(diagram);

            Assert.AreNotEqual(diagram, copiedDiagram);
        }
Beispiel #4
0
        public void TestCopy_CopyDiagramWithOneNode_NodeCopiedWithFullName()
        {
            var projectManagerMoq = new Mock <IProjectManager>();
            var copier            = new DiagramCopier(projectManagerMoq.Object);
            var diagram           = new DiagramModel();
            var node = new NodeModel("Node")
            {
                Name = "test"
            };

            diagram.AddNode(node);
            var copiedDiagram = copier.Copy(diagram);

            Assert.AreEqual(diagram.Nodes.First().Name, copiedDiagram.Nodes.First().Name);
        }