public void Calculate_Connectors_Works() { var nodes = CreateNodes( new NodeSpecification("A", new Size2D(1, 2)), new NodeSpecification("B", new Size2D(3, 4))); var connectors = CreateConnectors(nodes, new ConnectorSpecification("A", "B")); var layoutGroup = LayoutGroup.Create(nodes, connectors); var layoutAlgorithm = CreateLayoutAlgorithm(); var layout = layoutAlgorithm.Calculate(layoutGroup); layout.EdgeRoutes.Values.Should().BeEquivalentTo(new[] { new Route(new Point2D(0.5, 1), new Point2D(1.5, 6)) }); }
public void Calculate_Nodes_Works() { var layoutGroup = LayoutGroup.Create( CreateNodes( new NodeSpecification("A", new Size2D(1, 2)), new NodeSpecification("B", new Size2D(3, 4)), new NodeSpecification("C", new Size2D(5, 6))), ImmutableHashSet <IDiagramConnector> .Empty); var layout = CreateLayoutAlgorithm().Calculate(layoutGroup); layout.VertexRects.Values.Select(i => i.TopLeft) .Should().BeEquivalentTo(new Point2D(0, 0), new Point2D(0, 4), new Point2D(0, 10)); layout.EdgeRoutes.Should().BeEmpty(); }