Skip to content

Commit

Permalink
[#528] Add comments to new tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoding7 authored and prmr committed Mar 5, 2024
1 parent d988ef5 commit 3007773
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/org/jetuml/rendering/TestFontMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ public void testGetDimensions()
assertEquals(new Dimension(osDependent(95, 92, 92), osDependent(13, 12, 12)), aMetrics.getDimension("Single-Line-String"));
assertEquals(new Dimension(osDependent(31, 30, 30), osDependent(45, 40, 45)), aMetrics.getDimension("Multi\nLine\nString"));
}

private static int textBoxHeight(Text pText)
{
return (int) Math.round(pText.getLayoutBounds().getHeight());
}

@Test
public void testGetHeight_EmptyText()
Expand All @@ -95,4 +90,9 @@ public void testGetHeight_MultiLineText()
multiLineText.setFont(DEFAULT_FONT);
assertEquals(textBoxHeight(multiLineText), aMetrics.getHeight("Multi\nLine\nString"));
}

private static int textBoxHeight(Text pText)
{
return (int) Math.round(pText.getLayoutBounds().getHeight());
}
}
6 changes: 6 additions & 0 deletions test/org/jetuml/rendering/TestStringViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public void testWrapString()
StringRenderer.wrapString("A really long string that should probably be wrapped", 1));
}

/*
* Test different font styles for font size 12.
*/
@Test
public void testGetHeight_12ptFont()
{
Expand All @@ -148,6 +151,9 @@ public void testGetHeight_12ptFont()
assertEquals(textBoxHeight(text), topCenterBoldItalics.getHeight("Display String"));
}

/*
* Test different font styles for font size 24.
*/
@Test
public void testGetHeight_24ptFont()
{
Expand Down

0 comments on commit 3007773

Please sign in to comment.