PopUpCoachMarkPresenter { @PopUpPosition protected int getCorrectPositionOfCoachMarkIfDefaultFails(Point viewCenterPoint, CoachMarkPixelInfo coachMarkDimenInPixel) { @PopUpPosition int correctPopUpPosition = PopUpPosition.NONE; if (checkIfRightPossible(viewCenterPoint, coachMarkDimenInPixel)) correctPopUpPosition = PopUpPosition.RIGHT; else if (checkIfBottomPossible(viewCenterPoint, coachMarkDimenInPixel)) correctPopUpPosition = PopUpPosition.BOTTOM; else if (checkIfLeftPossible(viewCenterPoint, coachMarkDimenInPixel)) correctPopUpPosition = PopUpPosition.LEFT; else if (checkIfTopPossible(viewCenterPoint, coachMarkDimenInPixel)) correctPopUpPosition = PopUpPosition.TOP; return correctPopUpPosition; } PopUpCoachMarkPresenter(final IStringResourceProvider stringResourceProvider,
                                   final IDimensionResourceProvider dimensionResourceProvider,
                                   final ITypeFaceProvider typeFaceProvider,
                                   final IScreenInfoProvider screenInfoProvider); void onCreate(CoachMarkBuilder coachMarkBuilder); void onCreateView(IPopUpCoachMarkPresentation popUpCoachMarkPresentation); void onViewCreated(); void onDestroyView(); void onDestroy(); void onOkButtonClicked(); void onShimClicked();  }
@Test public void getCorrectPositionOfCoachMarkIfDefaultFailsRightPositionTest(){ MockedPoint point = new MockedPoint(400, 200); assertEquals(PopUpPosition.RIGHT, mPopUpCoachMarkPresenter. getCorrectPositionOfCoachMarkIfDefaultFails(point, mCoachMarkPixelInfo)); }
@Test public void getCorrectPositionOfCoachMarkIfDefaultFailsLeftPositionTest(){ MockedPoint point = new MockedPoint(700, 1020); assertEquals(PopUpPosition.LEFT, mPopUpCoachMarkPresenter. getCorrectPositionOfCoachMarkIfDefaultFails(point, mCoachMarkPixelInfo)); }
@Test public void getCorrectPositionOfCoachMarkIfDefaultFailsBottomPositionTest(){ MockedPoint point = new MockedPoint(700, 820); assertEquals(PopUpPosition.BOTTOM, mPopUpCoachMarkPresenter. getCorrectPositionOfCoachMarkIfDefaultFails(point, mCoachMarkPixelInfo)); }