Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Adds a test for border styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Sep 19, 2023
1 parent 07e459c commit 2c3ffa1
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -691,4 +691,32 @@ public void componentWithoutTechnology() {
"@enduml", diagram.getDefinition());
}

@Test
public void borderStyling() {
Workspace workspace = new Workspace("Name", "Description");
workspace.getModel().addSoftwareSystem("Name");
SystemLandscapeView view = workspace.getViews().createSystemLandscapeView("key", "Description");
view.addAllElements();
workspace.getViews().getConfiguration().addProperty(C4PlantUMLExporter.C4PLANTUML_TAGS_PROPERTY, "true");
workspace.getViews().getConfiguration().getStyles().addElementStyle(Tags.ELEMENT).stroke("green").border(Border.Dashed).strokeWidth(2);

Diagram diagram = new C4PlantUMLExporter().export(view);
assertEquals("@startuml\n" +
"set separator none\n" +
"title System Landscape\n" +
"\n" +
"top to bottom direction\n" +
"\n" +
"!include <C4/C4>\n" +
"!include <C4/C4_Context>\n" +
"\n" +
"AddElementTag(\"Element\", $bgColor=\"#dddddd\", $borderColor=\"#008000\", $fontColor=\"#000000\", $sprite=\"\", $shadowing=\"\", $borderStyle=\"Dashed\", $borderThickness=\"2\")\n" +
"\n" +
"System(Name, \"Name\", $descr=\"\", $tags=\"Element\", $link=\"\")\n" +
"\n" +
"\n" +
"SHOW_LEGEND(true)\n" +
"@enduml", diagram.getDefinition());
}

}

0 comments on commit 2c3ffa1

Please sign in to comment.