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