use of com.ichi2.libanki.Collection.CheckDatabaseResult 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.libanki.Collection.CheckDatabaseResult 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.libanki.Collection.CheckDatabaseResult in project Anki-Android by ankidroid.
the class DeckPickerCheckDatabaseListenerTest method validResultWithValidDataWillDisplayMessageBox.
@Test
public void validResultWithValidDataWillDisplayMessageBox() {
CheckDatabaseResult validData = validData();
Pair<Boolean, Collection.CheckDatabaseResult> result = validResultWithData(validData);
execute(result);
assertThat("Load Failed dialog should not be shown if invalid data is supplied", !mImpl.didDisplayDialogLoadFailed());
assertThat("Dialog should be displayed", mImpl.didDisplayMessage());
}
use of com.ichi2.libanki.Collection.CheckDatabaseResult in project Anki-Android by ankidroid.
the class DeckPickerCheckDatabaseListenerTest method validResultWithLockedDatabaseWillShowLockedDialog.
@Test
public void validResultWithLockedDatabaseWillShowLockedDialog() {
CheckDatabaseResult lockedDb = lockedDatabase();
Pair<Boolean, Collection.CheckDatabaseResult> result = validResultWithData(lockedDb);
execute(result);
assertThat("Load Failed dialog should not be shown if invalid data is supplied", !mImpl.didDisplayDialogLoadFailed());
assertThat("Locked Database dialog should be shown if Db was locked", mImpl.didDisplayLockedDialog());
assertThat("Dialog should not be displayed", !mImpl.didDisplayMessage());
}
use of com.ichi2.libanki.Collection.CheckDatabaseResult in project AnkiChinaAndroid by ankichinateam.
the class DeckPickerCheckDatabaseListenerTest method validResultWithLockedDatabaseWillShowLockedDialog.
@Test
public void validResultWithLockedDatabaseWillShowLockedDialog() {
CheckDatabaseResult lockedDb = lockedDatabase();
TaskData result = validResultWithData(lockedDb);
execute(result);
assertThat("Load Failed dialog should not be shown if invalid 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());
}
Aggregations