StatsContext extends GraphicalContext<BorderPane> { @Override public ObservableList<Node> getChildren() { return root.getChildren(); } StatsContext(GazePlay gazePlay, BorderPane root, Stats stats, CustomButton continueButton); @Override ObservableList<Node> getChildren();  }
@Test void shouldAddAreaChartOnColorBandSelected() { ArrayList<LinkedList<FixationPoint>> fixationPoints = new ArrayList<>(List.of( new LinkedList<>(List.of( new FixationPoint(1234, 2345, 30, 40), new FixationPoint(4567, 1234, 40, 60) )), new LinkedList<>(List.of( new FixationPoint(1234, 2345, 30, 40), new FixationPoint(4567, 1234, 40, 60) )) ) ); when(mockStats.getFixationSequence()).thenReturn(fixationPoints); Configuration mockConfig = mock(Configuration.class); when(mockConfig.getAreaOfInterestDisabledProperty()).thenReturn(new SimpleBooleanProperty(true)); new MockUp<ActiveConfigurationContext>() { @mockit.Mock public Configuration getInstance() { return mockConfig; } }; BorderPane root = new BorderPane(); new StatsContext(mockGazePlay, root, mockStats, null); BorderPane sidePane = (BorderPane) root.getCenter(); StackPane centerStackPane = (StackPane) sidePane.getTop(); VBox centerPane = (VBox) centerStackPane.getChildren().get(0); HBox controlPane = (HBox) sidePane.getBottom(); RadioButton colorBands = (RadioButton) controlPane.getChildren().get(1); LineChart<String, Number> lineChart = (LineChart<String, Number>) centerPane.getChildren().get(2); assertTrue(centerPane.getChildren().contains(lineChart)); colorBands.fire(); assertFalse(centerPane.getChildren().contains(lineChart)); colorBands.fire(); assertTrue(centerPane.getChildren().contains(lineChart)); }
@Test void shouldGetChildren() { BorderPane root = new BorderPane(); StatsContext context = new StatsContext(mockGazePlay, root, mockStats, null); assertEquals(root.getChildren().size(), context.getChildren().size()); }