summaryrefslogtreecommitdiff
path: root/tests/unit/Settings/StudySettings_test.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
committerJedidiah Barber <contact@jedbarber.id.au>2021-07-14 11:49:10 +1200
commitd24f813f3f2a05c112e803e4256b53535895fc98 (patch)
tree601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /tests/unit/Settings/StudySettings_test.cpp
Initial mirror commitHEADmaster
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);
+}