@Test public void testGetExitDirections() { Maneuver maneuver = mock(Maneuver.class); Signpost signpost = mock(Signpost.class); List<Signpost.LocalizedLabel> list = getDirectionsList(); when(signpost.getExitDirections()).thenReturn(list); when(maneuver.getSignpost()).thenReturn(signpost); mManeuverResources = new ManeuverResources(getApplicationContext(), null); assertEquals(DIRECTION, mManeuverResources.getExitDirections(maneuver)); }
public String getExitDirections(final Maneuver maneuver) { final Signpost signpost = maneuver.getSignpost(); if (signpost == null) { return null; } final List<Signpost.LocalizedLabel> exitDirections = signpost.getExitDirections(); if (exitDirections == null) { return null; } String exitDirectionsText = null; for (Signpost.LocalizedLabel label:exitDirections) { final String text = label.getText(); if (!TextUtils.isEmpty(text)) { exitDirectionsText = exitDirectionsText == null ? text : mContext.getString(R.string.msdkui_maneuver_road_name_divider, exitDirectionsText, text); } } return exitDirectionsText; }
ManeuverResources { public String getExitDirections(final Maneuver maneuver) { final Signpost signpost = maneuver.getSignpost(); if (signpost == null) { return null; } final List<Signpost.LocalizedLabel> exitDirections = signpost.getExitDirections(); if (exitDirections == null) { return null; } String exitDirectionsText = null; for (Signpost.LocalizedLabel label:exitDirections) { final String text = label.getText(); if (!TextUtils.isEmpty(text)) { exitDirectionsText = exitDirectionsText == null ? text : mContext.getString(R.string.msdkui_maneuver_road_name_divider, exitDirectionsText, text); } } return exitDirectionsText; } }
ManeuverResources { public String getExitDirections(final Maneuver maneuver) { final Signpost signpost = maneuver.getSignpost(); if (signpost == null) { return null; } final List<Signpost.LocalizedLabel> exitDirections = signpost.getExitDirections(); if (exitDirections == null) { return null; } String exitDirectionsText = null; for (Signpost.LocalizedLabel label:exitDirections) { final String text = label.getText(); if (!TextUtils.isEmpty(text)) { exitDirectionsText = exitDirectionsText == null ? text : mContext.getString(R.string.msdkui_maneuver_road_name_divider, exitDirectionsText, text); } } return exitDirectionsText; } @SuppressWarnings("PMD.NcssCount") // There is no purpose to break this constuctor into smaller functions. /** * Constructs a new instance using a list of maneuvers. */  ManeuverResources(final Context context, final List<Maneuver> maneuverList); }
ManeuverResources { public String getExitDirections(final Maneuver maneuver) { final Signpost signpost = maneuver.getSignpost(); if (signpost == null) { return null; } final List<Signpost.LocalizedLabel> exitDirections = signpost.getExitDirections(); if (exitDirections == null) { return null; } String exitDirectionsText = null; for (Signpost.LocalizedLabel label:exitDirections) { final String text = label.getText(); if (!TextUtils.isEmpty(text)) { exitDirectionsText = exitDirectionsText == null ? text : mContext.getString(R.string.msdkui_maneuver_road_name_divider, exitDirectionsText, text); } } return exitDirectionsText; } @SuppressWarnings("PMD.NcssCount") // There is no purpose to break this constuctor into smaller functions. /** * Constructs a new instance using a list of maneuvers. */  ManeuverResources(final Context context, final List<Maneuver> maneuverList); int getStartIconId(); int getDestinationIconId(); int getManeuverIconId(final int index); String getManeuverInstruction(final int index); int getDistanceFromNext(final int index); String getRoadToDisplay(final int index); String getExitDirections(final Maneuver maneuver); String getString(final Integer id); String getArrivedAtDestinationInstruction(); }
ManeuverResources { public String getExitDirections(final Maneuver maneuver) { final Signpost signpost = maneuver.getSignpost(); if (signpost == null) { return null; } final List<Signpost.LocalizedLabel> exitDirections = signpost.getExitDirections(); if (exitDirections == null) { return null; } String exitDirectionsText = null; for (Signpost.LocalizedLabel label:exitDirections) { final String text = label.getText(); if (!TextUtils.isEmpty(text)) { exitDirectionsText = exitDirectionsText == null ? text : mContext.getString(R.string.msdkui_maneuver_road_name_divider, exitDirectionsText, text); } } return exitDirectionsText; } @SuppressWarnings("PMD.NcssCount") // There is no purpose to break this constuctor into smaller functions. /** * Constructs a new instance using a list of maneuvers. */  ManeuverResources(final Context context, final List<Maneuver> maneuverList); int getStartIconId(); int getDestinationIconId(); int getManeuverIconId(final int index); String getManeuverInstruction(final int index); int getDistanceFromNext(final int index); String getRoadToDisplay(final int index); String getExitDirections(final Maneuver maneuver); String getString(final Integer id); String getArrivedAtDestinationInstruction();  }