public void Create_ConnectorInRootLayoutGroup_Works() { var model = _modelBuilder .AddNodes("A", "B") .AddRelationships("A->B") .Model; var relationship = _modelBuilder.GetRelationship("A->B"); var diagramBuilder = new DiagramBuilder(model).AddAllModelNodes().AddAllModelRelationships(); var layoutStructure = new DiagramLayoutStructure(diagramBuilder.GetDiagram()); layoutStructure.RootLayoutGroup.Connectors.ShouldBeEquivalentById(relationship.Id); layoutStructure.CrossLayoutGroupConnectors.Should().BeEmpty(); }
public void Create_OnlyNodes_Works() { var model = _modelBuilder .AddNodes("parent") .AddChildNodes("parent", "child") .Model; var parentNode = _modelBuilder.GetNode("parent"); var childNode = _modelBuilder.GetNode("child"); var diagramBuilder = new DiagramBuilder(model).AddAllModelNodes(); var layoutStructure = new DiagramLayoutStructure(diagramBuilder.GetDiagram()); layoutStructure.RootLayoutGroup.Nodes.ShouldBeEquivalentById(parentNode.Id); layoutStructure.TryGetLayoutGroupByNodeId(parentNode.Id).Value.Nodes.ShouldBeEquivalentById(childNode.Id); }
public void Create_OnlyNodes_Works() { var modelService = CreateModelService(); var parentNode = modelService.AddNode("parent"); var childNode = modelService.AddNode("child", parentNodeId: parentNode.Id); var diagramService = CreateDiagramService(modelService.LatestModel); diagramService.AddNode(parentNode.Id); diagramService.AddNode(childNode.Id, parentNode.Id); var layoutStructure = new DiagramLayoutStructure(diagramService.LatestDiagram); layoutStructure.RootLayoutGroup.Nodes.ShouldBeEquivalentById(parentNode.Id); layoutStructure.TryGetLayoutGroupByNodeId(parentNode.Id).Value.Nodes.ShouldBeEquivalentById(childNode.Id); }
public void Create_ConnectorInRootLayoutGroup_Works() { var modelService = CreateModelService(); var node1 = modelService.AddNode("node1"); var node2 = modelService.AddNode("node2"); var relationship = modelService.AddRelationship(node1.Id, node2.Id); var diagramService = CreateDiagramService(modelService.LatestModel); diagramService.AddNodes(new[] { node1.Id, node2.Id }); diagramService.AddConnector(relationship.Id); var layoutStructure = new DiagramLayoutStructure(diagramService.LatestDiagram); layoutStructure.RootLayoutGroup.Connectors.ShouldBeEquivalentById(relationship.Id); layoutStructure.CrossLayoutGroupConnectors.Should().BeEmpty(); }
public void Create_ConnectorInNestedLayoutGroup_Works() { var model = _modelBuilder .AddNodes("parent") .AddChildNodes("parent", "child1", "child2") .AddRelationships("child1->child2") .Model; var parentNode = _modelBuilder.GetNode("parent"); var relationship = _modelBuilder.GetRelationship("child1->child2"); var diagramBuilder = new DiagramBuilder(model).AddAllModelNodes().AddAllModelRelationships(); var layoutStructure = new DiagramLayoutStructure(diagramBuilder.GetDiagram()); layoutStructure.RootLayoutGroup.Connectors.Should().BeEmpty(); layoutStructure.CrossLayoutGroupConnectors.Should().BeEmpty(); layoutStructure.TryGetLayoutGroupByNodeId(parentNode.Id).Value.Connectors.ShouldBeEquivalentById(relationship.Id); }
public void Create_ConnectorInCrossLayoutGroup_Works() { var modelService = CreateModelService(); var parentNode = modelService.AddNode("parent"); var childNode = modelService.AddNode("child", parentNodeId: parentNode.Id); var relationship = modelService.AddRelationship(parentNode.Id, childNode.Id); var diagramService = CreateDiagramService(modelService.LatestModel); diagramService.AddNode(parentNode.Id); diagramService.AddNode(childNode.Id, parentNode.Id); diagramService.AddConnector(relationship.Id); var layoutStructure = new DiagramLayoutStructure(diagramService.LatestDiagram); layoutStructure.RootLayoutGroup.Connectors.Should().BeEmpty(); layoutStructure.CrossLayoutGroupConnectors.ShouldBeEquivalentById(relationship.Id); layoutStructure.TryGetLayoutGroupByNodeId(parentNode.Id).Value.Connectors.Should().BeEmpty(); }