Search in sources :

Example 6 with DeckManager

use of com.ichi2.libanki.DeckManager in project Anki-Android by ankidroid.

the class ReviewerTest method baseDeckName.

@Test
public void baseDeckName() {
    Collection col = getCol();
    ModelManager models = col.getModels();
    DeckManager decks = col.getDecks();
    Long didAb = addDeck("A::B");
    Model basic = models.byName(AnkiDroidApp.getAppResources().getString(R.string.basic_model_name));
    basic.put("did", didAb);
    addNoteUsingBasicModel("foo", "bar");
    Long didA = addDeck("A");
    decks.select(didA);
    Reviewer reviewer = startReviewer();
    waitForAsyncTasksToComplete();
    assertThat(reviewer.getSupportActionBar().getTitle(), is("B"));
}
Also used : Model(com.ichi2.libanki.Model) Collection(com.ichi2.libanki.Collection) DeckManager(com.ichi2.libanki.DeckManager) ModelManager(com.ichi2.libanki.ModelManager) Test(org.junit.Test)

Aggregations

DeckManager (com.ichi2.libanki.DeckManager)5 Test (org.junit.Test)5 Collection (com.ichi2.libanki.Collection)4 Deck (com.ichi2.libanki.Deck)3 RobolectricTest (com.ichi2.anki.RobolectricTest)2 Model (com.ichi2.libanki.Model)2 ModelManager (com.ichi2.libanki.ModelManager)2 Cursor (android.database.Cursor)1 Card (com.ichi2.libanki.Card)1 JSONObject (com.ichi2.utils.JSONObject)1