@Test public void should_Lookup_Showing_JSpinner_By_Name() { robot.showWindow(window); JSpinnerFixture fixture = new JSpinnerFixture(robot, "spinner"); assertThat(fixture.robot()).isSameAs(robot); assertThat(fixture.target()).isSameAs(window.spinner); }
@Test public void should_find_visible_JSpinner_by_Matcher() { robot.showWindow(window); JSpinnerFixture spinner = fixture.spinner( new GenericTypeMatcher<JSpinner>(JSpinner.class) { @Override protected boolean isMatching(@Nonnull JSpinner s) { return s.getValue().equals(8); } }); assertThat(spinner.target()).isSameAs(window.spinner); }
@Test public void should_find_visible_JSpinner_by_type() { robot.showWindow(window); JSpinnerFixture spinner = fixture.spinner(); assertThat(spinner.target()).isSameAs(window.spinner); }
@Test(expected = NullPointerException.class) public void should_throw_error_if_driver_is_null() { fixture.driver(null); }
@Override void onSetUp() { driver = createMock(JSpinnerDriver.class); fixture = new JSpinnerFixture(robot(), target); fixture.driver(driver); }