Skip to content

Commit

Permalink
using System.lineSeparator()
Browse files Browse the repository at this point in the history
  • Loading branch information
mccartney authored and wirew0rm committed Oct 17, 2022
1 parent ef5ee2e commit 5719d92
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,19 @@ public void start(Stage stage) {

@Test
void testThatTooltipIsShown(final FxRobot fxRobot) { // NOPMD JUnitTestsShouldIncludeAssert
final String NL = System.lineSeparator();
fxRobot.interrupt();

// ordered dataset
fxRobot.moveTo(getPointOnDataSet(xAxis1, yAxis1, ds1, 17)).moveBy(1, 0);
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'SpecialPoint'\n17.0, -0.8090169943749469"), DebugUtils.informedErrorMessage(fxRobot));
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'SpecialPoint'" + NL + "17.0, -0.8090169943749469"), DebugUtils.informedErrorMessage(fxRobot));
fxRobot.moveTo(getPointOnDataSet(xAxis1, yAxis1, ds1, 36)).moveBy(1, 0);
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'Cosine [36]'\n36.0, 0.3090169943749491"), DebugUtils.informedErrorMessage(fxRobot));
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'Cosine [36]'" + NL + "36.0, 0.3090169943749491"), DebugUtils.informedErrorMessage(fxRobot));

// unordered DataSet
fxRobot.interact(() -> renderer2.setAssumeSortedData(false));
fxRobot.moveTo(getPointOnDataSet(xAxis2, yAxis2, ds2, 5)).moveBy(1, 0);
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'nonsorted [5]'\n0.0, 0.1"), DebugUtils.informedErrorMessage(fxRobot));
FxAssert.verifyThat("." + DataPointTooltip.STYLE_CLASS_LABEL, hasText("'nonsorted [5]'" + NL + "0.0, 0.1"), DebugUtils.informedErrorMessage(fxRobot));
}

private Point2D getPointOnDataSet(final Axis xAxis, final Axis yAxis, final DataSet ds, final int index) {
Expand Down

0 comments on commit 5719d92

Please sign in to comment.