看從我SetupActivity下面的代碼片段活動解僱線程/任務 - 我怎麼能測試任務我解僱這裏其實正確執行?如何測試從Android的
例如這條線:從我的活動
new AttachChildGcmTask(app).execute(app.getChildInfo().getId());
代碼片段:
....
@Override
public void onClick(View v) {
if (v.getId() == R.id.btn_proceed) {
finishSetup();
}
}
private void finishSetup() {
UIUtilities.showToast(this, R.string.setup_completed, true);
final AppBipper app = (AppBipper) getApplication();
app.setSetupCompleted(true);
Log.i(TAG, "finishSetup childId: "+app.getChildInfo().getId());
new AttachChildGcmTask(app).execute(app.getChildInfo().getId());
Log.i(TAG, "download settings");
new FetchClientSettings(app).execute();
Log.i(TAG, "cancel all scheduled alarms");
ScheduledLocationsHelper helper =
ScheduledLocationsHelper.getInstance(app.getDBManager(), app);
helper.cancelAlarms();
startActivity(new Intent(this, StartupActivity.class));
finish();
}
你是詢問如何編寫功能/單元測試? –
只是做了一個小代碼格式化修復,所以沒有水平滾動(很煩人的事情)。 –