@Test public void renderTest() throws NoSuchFieldException, IllegalAccessException { OkAndCancelAtRightCornerButtonRenderer.Builder mBuilder = new OkAndCancelAtRightCornerButtonRenderer.Builder(Mockito.mock(Context.class)); OkAndCancelAtRightCornerButtonRenderer renderer = mBuilder.build(); OkAndCancelAtRightCornerButtonRendererView viewMock = Mockito.mock(OkAndCancelAtRightCornerButtonRendererView.class); ReflectionUtil.setField(OkAndCancelAtRightCornerButtonRenderer.class, renderer, "mView", viewMock); CoachmarkViewLayout layout = Mockito.mock(CoachmarkViewLayout.class); renderer.render(layout); verify(viewMock, times(1)).setDismissListener(layout); verify(layout, times(1)).addView(viewMock); }
@Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; }
OkAndCancelAtRightCornerButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; } }
OkAndCancelAtRightCornerButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; } private  OkAndCancelAtRightCornerButtonRenderer(OkAndCancelAtRightCornerButtonRendererView view); }
OkAndCancelAtRightCornerButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; } private  OkAndCancelAtRightCornerButtonRenderer(OkAndCancelAtRightCornerButtonRendererView view); @Override View render(final CoachmarkViewLayout layout); }
OkAndCancelAtRightCornerButtonRenderer implements ButtonRenderer { @Override public View render(final CoachmarkViewLayout layout) { mView.setDismissListener(layout); if (mView.getParent() == null) { layout.addView(mView); } return mView; } private  OkAndCancelAtRightCornerButtonRenderer(OkAndCancelAtRightCornerButtonRendererView view); @Override View render(final CoachmarkViewLayout layout);  }