NimbleRelativeLayout extends RelativeLayout implements NimbleView { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (!isInEditMode()) { presenter().takeView(getMvpView()); } } NimbleRelativeLayout(Context context);  NimbleRelativeLayout(Context context, AttributeSet attrs);  NimbleRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr); Activity getActivity();  }
@Test public void testOnAttachedToWindow() throws Exception { layout.onAttachedToWindow(); verify(layout).isInEditMode(); }
@Test public void onAttachedToWindow_inEditMode_doNothing() throws Exception { when(layout.isInEditMode()).thenReturn(true); layout.onAttachedToWindow(); verifyZeroInteractions(presenter); }
@Test public void onAttachedToWindow_notInEditMode_presenterTakeView() throws Exception { when(layout.isInEditMode()).thenReturn(false); layout.onAttachedToWindow(); verify(presenter).takeView(layout); }