Search in sources :

Example 11 with LearningData

use of org.liberty.android.fantastischmemo.entity.LearningData in project AnyMemo by helloworld1.

the class DefaultSchedulerTest method testScheduleForReviewardSuccess.

@SmallTest
@Test
public void testScheduleForReviewardSuccess() {
    LearningData newLd = defaultScheduler.schedule(forReviewCardLearningData, 5, false);
    assertFalse(defaultScheduler.isCardForReview(newLd));
    assertFalse(defaultScheduler.isCardNew(newLd));
    assertTrue(defaultScheduler.isCardLearned(newLd));
}
Also used : LearningData(org.liberty.android.fantastischmemo.entity.LearningData) SmallTest(android.support.test.filters.SmallTest) AbstractPreferencesTest(org.liberty.android.fantastischmemo.test.AbstractPreferencesTest) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 12 with LearningData

use of org.liberty.android.fantastischmemo.entity.LearningData in project AnyMemo by helloworld1.

the class DefaultSchedulerTest method testScheduleFailedCardSuccess.

@SmallTest
@Test
public void testScheduleFailedCardSuccess() {
    LearningData newLd = defaultScheduler.schedule(failedCardLearningData, 5, false);
    assertFalse(defaultScheduler.isCardForReview(newLd));
    assertFalse(defaultScheduler.isCardNew(newLd));
    assertTrue(defaultScheduler.isCardLearned(newLd));
}
Also used : LearningData(org.liberty.android.fantastischmemo.entity.LearningData) SmallTest(android.support.test.filters.SmallTest) AbstractPreferencesTest(org.liberty.android.fantastischmemo.test.AbstractPreferencesTest) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 13 with LearningData

use of org.liberty.android.fantastischmemo.entity.LearningData in project AnyMemo by helloworld1.

the class DefaultSchedulerTest method testScheduleFailedCardFailure.

@SmallTest
@Test
public void testScheduleFailedCardFailure() {
    LearningData newLd = defaultScheduler.schedule(failedCardLearningData, 0, false);
    assertTrue(defaultScheduler.isCardForReview(newLd));
    assertFalse(defaultScheduler.isCardNew(newLd));
    assertFalse(defaultScheduler.isCardLearned(newLd));
}
Also used : LearningData(org.liberty.android.fantastischmemo.entity.LearningData) SmallTest(android.support.test.filters.SmallTest) AbstractPreferencesTest(org.liberty.android.fantastischmemo.test.AbstractPreferencesTest) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 14 with LearningData

use of org.liberty.android.fantastischmemo.entity.LearningData in project AnyMemo by helloworld1.

the class DefaultSchedulerTest method testScheduleNewCardSuccess.

@SmallTest
@Test
public void testScheduleNewCardSuccess() {
    LearningData ld = new LearningData();
    LearningData newLd = defaultScheduler.schedule(ld, 3, false);
    assertFalse(defaultScheduler.isCardForReview(newLd));
    assertFalse(defaultScheduler.isCardNew(newLd));
    assertTrue(defaultScheduler.isCardLearned(newLd));
    assertEquals(3, (int) newLd.getGrade());
}
Also used : LearningData(org.liberty.android.fantastischmemo.entity.LearningData) SmallTest(android.support.test.filters.SmallTest) AbstractPreferencesTest(org.liberty.android.fantastischmemo.test.AbstractPreferencesTest) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Example 15 with LearningData

use of org.liberty.android.fantastischmemo.entity.LearningData in project AnyMemo by helloworld1.

the class DefaultSchedulerTest method testScheduleForScheduleCardFailure.

@SmallTest
@Test
public void testScheduleForScheduleCardFailure() {
    LearningData newLd = defaultScheduler.schedule(forReviewCardLearningData, 0, false);
    assertTrue(defaultScheduler.isCardForReview(newLd));
    assertFalse(defaultScheduler.isCardNew(newLd));
    assertFalse(defaultScheduler.isCardLearned(newLd));
}
Also used : LearningData(org.liberty.android.fantastischmemo.entity.LearningData) SmallTest(android.support.test.filters.SmallTest) AbstractPreferencesTest(org.liberty.android.fantastischmemo.test.AbstractPreferencesTest) Test(org.junit.Test) SmallTest(android.support.test.filters.SmallTest)

Aggregations

LearningData (org.liberty.android.fantastischmemo.entity.LearningData)42 Card (org.liberty.android.fantastischmemo.entity.Card)25 SmallTest (android.support.test.filters.SmallTest)15 Test (org.junit.Test)15 CardDao (org.liberty.android.fantastischmemo.dao.CardDao)15 Category (org.liberty.android.fantastischmemo.entity.Category)15 Date (java.util.Date)11 AnyMemoDBOpenHelper (org.liberty.android.fantastischmemo.common.AnyMemoDBOpenHelper)9 LearningDataDao (org.liberty.android.fantastischmemo.dao.LearningDataDao)8 AbstractPreferencesTest (org.liberty.android.fantastischmemo.test.AbstractPreferencesTest)8 ArrayList (java.util.ArrayList)7 AbstractExistingDBTest (org.liberty.android.fantastischmemo.test.AbstractExistingDBTest)7 SQLException (java.sql.SQLException)5 CategoryDao (org.liberty.android.fantastischmemo.dao.CategoryDao)5 File (java.io.File)4 IOException (java.io.IOException)3 BufferedReader (java.io.BufferedReader)2 BufferedWriter (java.io.BufferedWriter)2 FileReader (java.io.FileReader)2 FileWriter (java.io.FileWriter)2