public void ToDot_Should_Return_DiGraph_Entity() { var graph = new UndirectedGraph { Name = "a" }; var dot = graph.ToDot(); Assert.IsTrue(Regex.Match(dot, "^graph \\\"a\\\" \\{[^}]*\\}$", RegexOptions.Multiline).Success); }
public void Add_Returns_Parent_Expression() { var graph = new UndirectedGraph(); var a = new GraphNode("a"); var b = new GraphNode("b"); graph.AddNode(a); graph.AddNode(b); var graphExpression = new GraphExpression<IUndirectedGraph>(graph); var expression = new EdgeCollectionModifiersExpression<IGraphExpression>(graph, graphExpression); var instance = expression.Add(edges => edges.FromNodeWithName("a").ToNodeWithName("b")); Assert.AreSame(instance, graphExpression); }