blob: 098afa015c6560b609f45a4e102bcfcd13d78509 (
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
|
#include <gtest/gtest.h>
// stupid hack to allow access to private/protected members under test
#define private public
#define protected public
#include <crepe/manager/SaveManager.h>
#include <crepe/facade/DB.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);
}
|