summaryrefslogtreecommitdiff
path: root/tests/unit/SpacedRepetitionModel/SRModel_test.h
blob: 9e5d66906e01bb6332f17e3f449fbf7d72b3656d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SPACED_REPETITION_MODEL_TEST_H
#define SPACED_REPETITION_MODEL_TEST_H

#include <gtest/gtest.h>
#include <iostream>
#include <QtCore>

#include "../../../src/study/SpacedRepetitionModel.h"
#include "../../../src/dictionary/CardPack.h"
#include "../../mocks/Dictionary_mock.h"

using std::ostream;

class MockRandomGenerator;
class Field;

class TestSpacedRepetitionModel: public SpacedRepetitionModel
{
public:
    TestSpacedRepetitionModel(CardPack* pack, IRandomGenerator* random):
        SpacedRepetitionModel(pack, random) {}
    void testPickCard() { pickNextCardAndNotify(); }
};

class SRModelTest: public testing::Test
{
public:
    SRModelTest();

protected:
    void SetUp();
    void TearDown();
    QString createCard();
    QString addRecord();

protected:
    MockDictionary dict;
    int recordId;
    Field* field1;
    Field* field2;
    CardPack pack;
    MockRandomGenerator* randomGenerator;
    TestSpacedRepetitionModel model;
};

#endif