use of com.ichi2.async.TaskData in project AnkiChinaAndroid by ankichinateam.
the class DeckPickerCheckDatabaseListenerTest method validResultWithValidDataWillDisplayMessageBox.
@Test
public void validResultWithValidDataWillDisplayMessageBox() {
CheckDatabaseResult validData = validData();
TaskData result = validResultWithData(validData);
execute(result);
assertThat("Load Failed dialog should not be shown if invalid data is supplied", !impl.didDisplayDialogLoadFailed());
assertThat("Dialog should be displayed", impl.didDisplayMessage());
}
use of com.ichi2.async.TaskData in project AnkiChinaAndroid by ankichinateam.
the class DeckPickerCheckDatabaseListenerTest method failedResultWithEmptyDataWillDisplayFailedDialog.
@Test
public void failedResultWithEmptyDataWillDisplayFailedDialog() {
TaskData result = failedResultWithData();
execute(result);
assertThat("Load Failed dialog should be shown if empty data is supplied", impl.didDisplayDialogLoadFailed());
}
use of com.ichi2.async.TaskData in project AnkiChinaAndroid by ankichinateam.
the class DeckPickerCheckDatabaseListenerTest method validResultWithFailedDatabaseWillShowFailedDialog.
@Test
public void validResultWithFailedDatabaseWillShowFailedDialog() {
CheckDatabaseResult failedDb = failedDatabase();
TaskData result = validResultWithData(failedDb);
execute(result);
assertThat("Load Failed dialog should be shown if failed data is supplied", impl.didDisplayDialogLoadFailed());
assertThat("Locked Database dialog should be shown if Db was locked", !impl.didDisplayLockedDialog());
assertThat("Dialog should not be displayed", !impl.didDisplayMessage());
}
use of com.ichi2.async.TaskData in project AnkiChinaAndroid by ankichinateam.
the class DeckPickerCheckDatabaseListenerTest method validResultWithEmptyDataWillDoNothing.
@Test
public void validResultWithEmptyDataWillDoNothing() {
TaskData result = validResultWithData();
execute(result);
assertThat("Nothing should be shown if valid, but no data supplied", !impl.didDisplayDialogLoadFailed());
assertThat("Nothing should be shown if valid, but no data supplied", !impl.didDisplayLockedDialog());
assertThat("Nothing should be shown if valid, but no data supplied", !impl.didDisplayMessage());
}
use of com.ichi2.async.TaskData in project Anki-Android by Ramblurr.
the class DeckTask method doInBackgroundSaveCollection.
private TaskData doInBackgroundSaveCollection(TaskData... params) {
Log.i(AnkiDroidApp.TAG, "doInBackgroundSaveCollection");
Collection col = params[0].getCollection();
if (col != null) {
try {
col.save();
} catch (RuntimeException e) {
Log.e(AnkiDroidApp.TAG, "Error on saving deck in background: " + e);
}
}
return null;
}
Aggregations