22import static org .assertj .core .api .Assertions .assertThat ;
33
44import java .util .Map ;
5+
56import org .junit .jupiter .api .Disabled ;
67import org .junit .jupiter .api .DisplayName ;
78import org .junit .jupiter .api .Test ;
@@ -31,8 +32,8 @@ public void testGraphWithOneNode() {
3132
3233 @ Test
3334 @ Disabled
34- @ DisplayName ("graph with one node with keywords " )
35- public void testGraphWithOneNodeWithKeywords () {
35+ @ DisplayName ("graph with one node with attribute " )
36+ public void testGraphWithOneNodeWithAttribute () {
3637 Graph graph = new Graph ().node ("a" , Map .of ("color" , "green" ));
3738
3839 assertThat (graph .getNodes ())
@@ -55,8 +56,8 @@ public void testGraphWithOneEdge() {
5556
5657 @ Test
5758 @ Disabled
58- @ DisplayName ("graph with one edge with keywords " )
59- public void testGraphWithOneEdgeWithKeywords () {
59+ @ DisplayName ("graph with one edge with attribute " )
60+ public void testGraphWithOneEdgeWithAttribute () {
6061 Graph graph = new Graph ().edge ("a" , "b" , Map .of ("color" , "blue" ));
6162
6263 assertThat (graph .getNodes ()).isEmpty ();
@@ -78,8 +79,8 @@ public void testGraphWithOneAttribute() {
7879
7980 @ Test
8081 @ Disabled
81- @ DisplayName ("graph with attributes" )
82- public void testGraphWithAttributes () {
82+ @ DisplayName ("graph with nodes, edges, and attributes" )
83+ public void testGraphWithNodesEdgesAndAttributes () {
8384 Graph graph = new Graph (Map .of ("foo" , "1" , "title" , "Testing Attrs" , "bar" , "true" ))
8485 .node ("a" , Map .of ("color" , "green" ))
8586 .node ("c" )
@@ -95,11 +96,40 @@ public void testGraphWithAttributes() {
9596
9697 assertThat (graph .getEdges ())
9798 .containsExactlyInAnyOrder (
98- new Edge ("a" , "b" , Map .of ("color" , "blue" )),
99+ new Edge ("a" , "b" , Map .of ("color" , "blue" )),
99100 new Edge ("b" , "c" ));
100101
101102 assertThat (graph .getAttributes ())
102103 .containsExactlyInAnyOrderEntriesOf (
103104 Map .of ("foo" , "1" , "title" , "Testing Attrs" , "bar" , "true" ));
104105 }
106+
107+ @ Test
108+ @ Disabled
109+ @ DisplayName ("multiple edges on one line" )
110+ public void testMultipleEdgesOnOneLine () {
111+ Graph graph = new Graph ()
112+ .node ("a" )
113+ .node ("b" )
114+ .node ("c" )
115+ .node ("d" )
116+ .edge ("a" , "b" , Map .of ("style" , "dotted" ))
117+ .edge ("b" , "c" , Map .of ("style" , "dotted" ))
118+ .edge ("c" , "d" , Map .of ("style" , "dotted" ));
119+
120+ assertThat (graph .getNodes ()).containsExactlyInAnyOrder (
121+ new Node ("a" ),
122+ new Node ("b" ),
123+ new Node ("c" ),
124+ new Node ("d" )
125+ );
126+
127+ assertThat (graph .getEdges ())
128+ .containsExactlyInAnyOrder (
129+ new Edge ("a" , "b" , Map .of ("style" , "dotted" )),
130+ new Edge ("b" , "c" , Map .of ("style" , "dotted" )),
131+ new Edge ("c" , "d" , Map .of ("style" , "dotted" ))
132+ );
133+ assertThat (graph .getAttributes ()).isEmpty ();
134+ }
105135}
0 commit comments