SketchInteractionListener implements RainbowInputController.RainbowInteractionListener { @Override public void onSketchTouched(MotionEvent event) { if (hasPaintListener()) { paintListener.onPaintingStart(); } inkPerformer.reset(); } SketchInteractionListener(StepPerformer inkPerformer); static SketchInteractionListener newInstance(StepPerformer inkPerformer); @Override void onSketchTouched(MotionEvent event); @Override void onSketchReleased(MotionEvent event); @Override void onFingerDragged(MotionEvent event); @Override void onMotionEvent(MotionEvent event); void setPaintListener(ZenSketch.PaintListener paintListener);  }
@Test public void testThatOnScreenTouchedPerformsResetOnInkPerformer() { sketchInteractionListener.onSketchTouched(motionEvent); verify(inkPerformer).reset(); }
@Test public void testThatIfHaveOnPaintingListenerThenOnScreenTouchFiresOnPaintingStart() { givenThatHasPaintingListener(); sketchInteractionListener.onSketchTouched(motionEvent); verify(listener).onPaintingStart(); }
@Test public void testThatIfDoesNotHaveOnPaintingListenerThenOnScreenTouchDoesNotFireOnPaintingStart() { sketchInteractionListener.onSketchTouched(motionEvent); verify(listener, never()).onPaintingStart(); }