@Test public void onScanError_noChannels() { fragment.onScanError(ERROR_NO_CHANNELS); ShadowLooper.idleMainLooper(); Assert.assertEquals("No channels found", ShadowToast.getTextOfLatestToast()); }
@Override public void onScanError(int errorCode) { String message; switch (errorCode) { case EpgSyncJobService.ERROR_EPG_SYNC_CANCELED: message = getString(R.string.tif_channel_scan_canceled); break; case EpgSyncJobService.ERROR_NO_PROGRAMS: message = getString(R.string.tif_channel_error_no_programs); break; case EpgSyncJobService.ERROR_NO_CHANNELS: message = getString(R.string.tif_channel_error_no_channels); break; default: message = getString(R.string.tif_channel_error_unknown); break; } Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); }
ChannelSetupStepFragment extends GuidedStepFragment implements SyncListener { @Override public void onScanError(int errorCode) { String message; switch (errorCode) { case EpgSyncJobService.ERROR_EPG_SYNC_CANCELED: message = getString(R.string.tif_channel_scan_canceled); break; case EpgSyncJobService.ERROR_NO_PROGRAMS: message = getString(R.string.tif_channel_error_no_programs); break; case EpgSyncJobService.ERROR_NO_CHANNELS: message = getString(R.string.tif_channel_error_no_channels); break; default: message = getString(R.string.tif_channel_error_unknown); break; } Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); } }
ChannelSetupStepFragment extends GuidedStepFragment implements SyncListener { @Override public void onScanError(int errorCode) { String message; switch (errorCode) { case EpgSyncJobService.ERROR_EPG_SYNC_CANCELED: message = getString(R.string.tif_channel_scan_canceled); break; case EpgSyncJobService.ERROR_NO_PROGRAMS: message = getString(R.string.tif_channel_error_no_programs); break; case EpgSyncJobService.ERROR_NO_CHANNELS: message = getString(R.string.tif_channel_error_no_channels); break; default: message = getString(R.string.tif_channel_error_unknown); break; } Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); }  }
ChannelSetupStepFragment extends GuidedStepFragment implements SyncListener { @Override public void onScanError(int errorCode) { String message; switch (errorCode) { case EpgSyncJobService.ERROR_EPG_SYNC_CANCELED: message = getString(R.string.tif_channel_scan_canceled); break; case EpgSyncJobService.ERROR_NO_PROGRAMS: message = getString(R.string.tif_channel_error_no_programs); break; case EpgSyncJobService.ERROR_NO_CHANNELS: message = getString(R.string.tif_channel_error_no_channels); break; default: message = getString(R.string.tif_channel_error_unknown); break; } Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); }  @Override void onCreate(Bundle savedInstanceState); @Override ChannelSetupStylist onCreateGuidanceStylist(); @Override Guidance onCreateGuidance(Bundle savedInstanceState); @Override void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState); @Override ChannelSetupStylist getGuidanceStylist(); @Override void onStart(); abstract Class<J> getEpgSyncJobServiceClass(); @Override void onGuidedActionClicked(GuidedAction action); @Override void onScanStepCompleted(int completedStep, int totalSteps); @Override void onScannedChannel(CharSequence displayName, CharSequence displayNumber); @Override void onScanFinished(); long getFullSyncWindowSec(); long getFullSyncFrequencyMillis(); @Override void onScanError(int errorCode); }
ChannelSetupStepFragment extends GuidedStepFragment implements SyncListener { @Override public void onScanError(int errorCode) { String message; switch (errorCode) { case EpgSyncJobService.ERROR_EPG_SYNC_CANCELED: message = getString(R.string.tif_channel_scan_canceled); break; case EpgSyncJobService.ERROR_NO_PROGRAMS: message = getString(R.string.tif_channel_error_no_programs); break; case EpgSyncJobService.ERROR_NO_CHANNELS: message = getString(R.string.tif_channel_error_no_channels); break; default: message = getString(R.string.tif_channel_error_unknown); break; } Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); }  @Override void onCreate(Bundle savedInstanceState); @Override ChannelSetupStylist onCreateGuidanceStylist(); @Override Guidance onCreateGuidance(Bundle savedInstanceState); @Override void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState); @Override ChannelSetupStylist getGuidanceStylist(); @Override void onStart(); abstract Class<J> getEpgSyncJobServiceClass(); @Override void onGuidedActionClicked(GuidedAction action); @Override void onScanStepCompleted(int completedStep, int totalSteps); @Override void onScannedChannel(CharSequence displayName, CharSequence displayNumber); @Override void onScanFinished(); long getFullSyncWindowSec(); long getFullSyncFrequencyMillis(); @Override void onScanError(int errorCode);  }