diff options
author | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:05:33 +0100 |
---|---|---|
committer | JAROWMR <jarorutjes07@gmail.com> | 2024-12-12 15:05:33 +0100 |
commit | 641e202607b0f694df6662532f0165022c0f8621 (patch) | |
tree | 0701bbfe705a95b670c8dfcb5eaabf6007556831 /src/test/ScriptSaveManagerTest.cpp | |
parent | dd7d5cf6b01b8a6a4238b66c27861ee76522067e (diff) | |
parent | 05a33d4793520fa84a93bc79882ef29d39cd08e5 (diff) |
merge master
Diffstat (limited to 'src/test/ScriptSaveManagerTest.cpp')
-rw-r--r-- | src/test/ScriptSaveManagerTest.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/ScriptSaveManagerTest.cpp b/src/test/ScriptSaveManagerTest.cpp new file mode 100644 index 0000000..64403c4 --- /dev/null +++ b/src/test/ScriptSaveManagerTest.cpp @@ -0,0 +1,35 @@ +#include <gtest/gtest.h> + +// stupid hack to allow access to private/protected members under test +#define private public +#define protected public + +#include <crepe/facade/DB.h> +#include <crepe/manager/SaveManager.h> + +#include "ScriptTest.h" + +using namespace std; +using namespace crepe; +using namespace testing; + +class ScriptSaveManagerTest : public ScriptTest { +public: + class TestSaveManager : public SaveManager { + using SaveManager::SaveManager; + + // in-memory database for testing + DB db{}; + virtual DB & get_db() override { return this->db; } + }; + + TestSaveManager save_mgr{mediator}; +}; + +TEST_F(ScriptSaveManagerTest, GetSaveManager) { + MyScript & script = this->script; + + SaveManager & mgr = script.get_save_manager(); + + EXPECT_EQ(&mgr, &save_mgr); +} |