summaryrefslogtreecommitdiff
path: root/tests/unit/Settings/StudySettings_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/Settings/StudySettings_test.cpp')
-rw-r--r--tests/unit/Settings/StudySettings_test.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/unit/Settings/StudySettings_test.cpp b/tests/unit/Settings/StudySettings_test.cpp
new file mode 100644
index 0000000..d66b8a1
--- /dev/null
+++ b/tests/unit/Settings/StudySettings_test.cpp
@@ -0,0 +1,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);
+}