summaryrefslogtreecommitdiff
path: root/tests/unit/Settings/StudySettings_test.cpp
blob: d66b8a1f516c3d08d7de7881832bb16eae582e64 (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
#include "StudySettings_test.h"
#include "../../common/printQtTypes.h"
#include "TestSettings.h"

void StudySettingsTest::SetUp()
{
    TestSettings::init();
}

StudySettings StudySettingsTest::getDefaults()
{
    StudySettings defaults;
    defaults.dayShift = 3;
    return defaults;
}

StudySettings StudySettingsTest::getUserSettings()
{

    StudySettings user;
    user.dayShift = 4;
    return user;
}

TEST_F(StudySettingsTest, DefaultValues)
{
    StudySettings settings;
    SCOPED_TRACE("Default values");
    check(getDefaults(), settings);
}

TEST_F(StudySettingsTest, UserValues)
{
    StudySettings::inst()->load();
    SCOPED_TRACE("User values");    
    check(getUserSettings(), *StudySettings::inst());
}

void StudySettingsTest::check(const StudySettings& expected, const StudySettings& actual)
{
    ASSERT_EQ(expected.dayShift, actual.dayShift);
}