Skip to content

Commit

Permalink
updated unit tests to match updated axis default font
Browse files Browse the repository at this point in the history
  • Loading branch information
ennerf committed Aug 8, 2023
1 parent f2e05d2 commit f6c0a75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void testBasicGetterSetters() {
assertTrue(state.isDirty(ChartBits.AxisLayout));
state.clear(ChartBits.AxisLayout);
}
axis.setSide(null);
assertThrows(IllegalArgumentException.class, () -> axis.setSide(null));
assertEquals(Double.NaN, axis.getLength());
axis.setSide(Side.LEFT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ void testHelper() {
axis.setUnit(null);
axis.setSide(Side.BOTTOM);
assertEquals(+1.0, axis.calculateNewScale(10, -5.0, +5.0));
assertEquals(+25, axis.computePrefHeight(100), 2);
assertEquals(+30, axis.computePrefHeight(100), 2);
assertEquals(+150.0, axis.computePrefWidth(-1));
axis.setSide(Side.LEFT);
assertEquals(-1.0, axis.calculateNewScale(10, -5.0, +5.0));
assertEquals(+150, axis.computePrefHeight(-1));
assertEquals(+22, axis.computePrefWidth(100), 2);
assertEquals(+26, axis.computePrefWidth(100), 2);

axis.setUnit("");
axis.setSide(Side.BOTTOM);
assertEquals(+44, axis.computePrefHeight(100), 2);
assertEquals(+49, axis.computePrefHeight(100), 2);
assertEquals(+150.0, axis.computePrefWidth(-1));
axis.setSide(Side.LEFT);
assertEquals(+150, axis.computePrefHeight(-1));
assertEquals(+44, axis.computePrefWidth(100), 2);
assertEquals(+48, axis.computePrefWidth(100), 2);

assertDoesNotThrow(axis::clear);
assertDoesNotThrow(axis::forceRedraw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void rightSide() {
@TestFx
void setMarkerValue() {
valueWatchIndicatorTested.setMarkerValue(35.15);
assertTrue(valueWatchIndicatorTested.getText().matches("35[\\.,]15")); // US or German locale
assertEquals("35", valueWatchIndicatorTested.getText());
assertEquals(35.15, valueWatchIndicatorTested.getValue(), 1e-2);
}

Expand Down

0 comments on commit f6c0a75

Please sign in to comment.