MCPcopy Create free account
hub / github.com/cschanck/single-file-java / testNodes

Method testNodes

src/test/java/org/sfj/DrawDotTest.java:37–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35public class DrawDotTest {
36
37 @Test
38 public void testNodes() {
39 Node node1 = new Node("a");
40 Node node2 = new Node("b");
41 Node node3 = new Node("a");
42
43 assertThat(node1, is(node1));
44 assertThat(node1, is(node3));
45 assertThat(node1, not(is(node2)));
46
47 node1.color(DrawDot.ColorsSVG.aliceblue)
48 .shaped(DrawDot.Shapes.ELLIPSE)
49 .commentBefore("before")
50 .commentAfter("after")
51 .style(DrawDot.NodeStyle.bold)
52 .label("label");
53
54 assertThat(node1.getAttributes().get("color").value.toString(), is(DrawDot.ColorsSVG.aliceblue.name()));
55 assertThat(node1.getAttributes().get("shape").value.toString(), is(DrawDot.Shapes.ELLIPSE.name()));
56 assertThat(node1.getAttributes().get("label").value.toString(), is("label"));
57 assertThat(node1.getAttributes().get("style").value.toString(), is(DrawDot.NodeStyle.bold.name()));
58 assertThat(node1.getCommentsBefore().get(0), is("before"));
59 assertThat(node1.getCommentsAfter().get(0), is("after"));
60
61 node2.style(DrawDot.NodeStyle.diagonals, DrawDot.ColorsSVG.cadetblue, DrawDot.ColorsSVG.antiquewhite).html("<b>test</b>");
62 assertThat(node2.getAttributes().get("style").value.toString(), is(DrawDot.NodeStyle.diagonals.name()));
63 assertThat(node2.getAttributes().get("fillcolor").value.toString(),
64 is(DrawDot.ColorsSVG.cadetblue + ":" + DrawDot.ColorsSVG.antiquewhite));
65 assertThat(node2.getAttributes().get("label").value.toString(), is("<b>test</b>"));
66 }
67
68 @Test
69 public void testConnections() {

Callers

nothing calls this directly

Calls 12

getCommentsBeforeMethod · 0.95
getCommentsAfterMethod · 0.95
labelMethod · 0.80
commentAfterMethod · 0.80
commentBeforeMethod · 0.80
shapedMethod · 0.80
colorMethod · 0.80
getAttributesMethod · 0.80
htmlMethod · 0.80
styleMethod · 0.65
getMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected