LynxView extends RelativeLayout implements LynxPresenter.View { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (isVisible()) { resumePresenter(); } } LynxView(Context context);  LynxView(Context context, AttributeSet attrs);  LynxView(Context context, AttributeSet attrs, int defStyleAttr); void setLynxConfig(LynxConfig lynxConfig); LynxConfig getLynxConfig(); @Override void showTraces(List<Trace> traces, int removedTraces); @Override void clear(); @CheckResult @Override boolean shareTraces(String fullTraces); @Override void notifyShareTracesFailed(); @Override void disableAutoScroll(); @Override void enableAutoScroll();  }
@Test public void shouldPausePresenterOnVisibilityChangedToNoVisible() { lynxView.onAttachedToWindow(); lynxView.setVisibility(View.GONE); verify(presenter).pause(); }
@Test public void shouldResumePresenterOnAttachedToWindowAndViewIsVisible() { lynxView.onAttachedToWindow(); verify(presenter).resume(); }
@Test public void shouldNotResumePresenterOnAttachedToWindowIfViewIsNotVisible() { lynxView.setVisibility(View.INVISIBLE); lynxView.onAttachedToWindow(); verify(presenter, never()).resume(); }
@Test public void shouldResumePresenterOnVisibilityChangedToVisible() { lynxView.onAttachedToWindow(); lynxView.setVisibility(View.VISIBLE); verify(presenter).resume(); }