Search in sources :

Example 1 with MutableTime

use of com.ichi2.testutils.MutableTime in project Anki-Android by ankidroid.

the class SchedTest method testRevLogValues.

@Test
public void testRevLogValues() {
    MutableTime time = new MutableTime(MockTime.timeStamp(2020, 8, 4, 11, 22, 19, 123), 10);
    Collection col = CollectionHelper.getInstance().getCol(getTargetContext(), time);
    addNoteUsingBasicModel("Hello", "World");
    AbstractSched sched = col.getSched();
    Card c = sched.getCard();
    time.setFrozen(true);
    long currentTime = time.getInternalTimeMs();
    sched.answerCard(c, BUTTON_ONE);
    long timeAnswered = col.getDb().queryLongScalar("select id from revlog");
    assertThat(timeAnswered, is(currentTime));
}
Also used : MutableTime(com.ichi2.testutils.MutableTime) Collection(com.ichi2.libanki.Collection) Card(com.ichi2.libanki.Card) RobolectricTest(com.ichi2.anki.RobolectricTest) Test(org.junit.Test)

Aggregations

RobolectricTest (com.ichi2.anki.RobolectricTest)1 Card (com.ichi2.libanki.Card)1 Collection (com.ichi2.libanki.Collection)1 MutableTime (com.ichi2.testutils.MutableTime)1 Test (org.junit.Test)1