AdAlertGestureListener extends GestureDetector.SimpleOnGestureListener { @Deprecated float getMinimumDipsInZigZag() { return mCurrentThresholdInDips; } AdAlertGestureListener(View view, AdConfiguration adConfiguration); @Override boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);  }
@Test public void constructor_shouldSetThresholdToOneThirdOfViewsWidth() throws Exception { stub(view.getWidth()).toReturn(150); subject = new AdAlertGestureListener(view, adConfiguration); assertThat(subject.getMinimumDipsInZigZag()).isEqualTo(50); }
@Test public void constructor_whenViewWidthIsWiderThanThreeTimesMaxThreshold_shouldSetThresholdTo100() throws Exception { stub(view.getWidth()).toReturn(500); subject = new AdAlertGestureListener(view, adConfiguration); assertThat(subject.getMinimumDipsInZigZag()).isEqualTo(100); }
@Test public void constructor_whenViewWidthIs0_shouldSetThresholdTo100() throws Exception { stub(view.getWidth()).toReturn(0); subject = new AdAlertGestureListener(view, adConfiguration); assertThat(subject.getMinimumDipsInZigZag()).isEqualTo(100); }