blob: e708149ea845b8717d1a4fc035da4a42fba563e7 [file] [log] [blame]
Václav Kubernát43908fb2020-01-02 19:05:51 +01001/*
2 * Copyright (C) 2020 CESNET, https://photonics.cesnet.cz/
3 *
4 * Written by Václav Kubernát <kubernat@cesnet.cz>
5 *
6*/
7
Václav Kubernátb4e5b182020-11-16 19:55:09 +01008#include "trompeloeil_doctest.hpp"
Václav Kubernát43908fb2020-01-02 19:05:51 +01009#include <map>
10#include "datastore_access.hpp"
Václav Kubernát43908fb2020-01-02 19:05:51 +010011#include "utils.hpp"
12
13namespace trompeloeil {
14 template <>
15 inline void print(std::ostream& os, const leaf_data_& data)
16 {
17 os << leafDataToString(data);
18 }
19}
20
21class MockDatastoreAccess : public trompeloeil::mock_interface<DatastoreAccess> {
Václav Kubernátd6282912020-06-23 14:49:34 +020022 IMPLEMENT_CONST_MOCK1(getItems);
Václav Kubernát43908fb2020-01-02 19:05:51 +010023 IMPLEMENT_MOCK2(setLeaf);
Jan Kundrátcbf288b2020-06-18 20:44:39 +020024 IMPLEMENT_MOCK1(createItem);
25 IMPLEMENT_MOCK1(deleteItem);
Václav Kubernátbf65dd72020-05-28 02:32:31 +020026 IMPLEMENT_MOCK2(moveItem);
Václav Kubernátb3960f82020-12-01 03:21:48 +010027 IMPLEMENT_MOCK2(execute);
Václav Kubernát43908fb2020-01-02 19:05:51 +010028
29 // Can't use IMPLEMENT_MOCK for private methods - IMPLEMENT_MOCK needs full visibility of the method
30 MAKE_MOCK1(listInstances, std::vector<ListInstance>(const std::string&), override);
31
32
33 IMPLEMENT_MOCK0(schema);
34
35 IMPLEMENT_MOCK0(commitChanges);
36 IMPLEMENT_MOCK0(discardChanges);
Václav Kubernát7160a132020-04-03 02:11:01 +020037 IMPLEMENT_MOCK2(copyConfig);
Václav Kubernát70d7f7a2020-06-23 14:40:40 +020038 IMPLEMENT_CONST_MOCK1(dump);
Václav Kubernát43908fb2020-01-02 19:05:51 +010039};