PlotCornerResetButtonManager { void resetY() { if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { resetNonTimeAxis(); } else { resetTimeAxis(); } } PlotCornerResetButtonManager(PlotterPlot thePlot); void updateButtons();  }
@Test public void resetY() { Mockito.when(plot.getAxisOrientationSetting()).thenReturn(AxisOrientationSetting.Y_AXIS_AS_TIME); plot.setNonTimeMinFixedByPlotSettings(false); plot.setNonTimeMaxFixedByPlotSettings(false); pcm.resetY(); verify(plot, never()).setNonTimeMinFixed(false); verify(plot, never()).setNonTimeMaxFixed(false); Mockito.when(plot.getAxisOrientationSetting()).thenReturn(AxisOrientationSetting.X_AXIS_AS_TIME); Mockito.when(plot.isPaused()).thenReturn(true); pcm.resetY(); verify(plot, atLeastOnce()).setNonTimeMinFixed(false); verify(plot, atLeastOnce()).setNonTimeMaxFixed(false); Mockito.when(plot.isPaused()).thenReturn(false); pcm.resetY(); verify(plot, atLeastOnce()).setNonTimeMinFixed(false); verify(plot, atLeastOnce()).setNonTimeMaxFixed(false); }