Search in sources :

Example 1 with FlagDef

use of com.ichi2.anki.reviewer.CardMarker.FlagDef in project AnkiChinaAndroid by ankichinateam.

the class AbstractFlashcardViewerCommandTest method cardWith.

private Card cardWith(@FlagDef int flag) {
    Card c = mock(Card.class);
    int[] flags = new int[] { flag };
    when(c.userFlag()).then((invocation) -> flags[0]);
    doAnswer(invocation -> {
        flags[0] = invocation.getArgument(0);
        return null;
    }).when(c).setUserFlag(anyInt());
    return c;
}
Also used : Card(com.ichi2.libanki.Card)

Example 2 with FlagDef

use of com.ichi2.anki.reviewer.CardMarker.FlagDef in project Anki-Android by ankidroid.

the class AbstractFlashcardViewerCommandTest method cardWith.

private Card cardWith(@FlagDef int flag) {
    Card c = mock(Card.class);
    int[] flags = new int[] { flag };
    when(c.userFlag()).then((invocation) -> flags[0]);
    doAnswer(invocation -> {
        flags[0] = invocation.getArgument(0);
        return null;
    }).when(c).setUserFlag(anyInt());
    return c;
}
Also used : Card(com.ichi2.libanki.Card)

Aggregations

Card (com.ichi2.libanki.Card)2