Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 1 | /* |
| 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át | b4e5b18 | 2020-11-16 19:55:09 +0100 | [diff] [blame] | 8 | #include "trompeloeil_doctest.hpp" |
Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 9 | #include <map> |
| 10 | #include "datastore_access.hpp" |
Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 11 | #include "utils.hpp" |
| 12 | |
| 13 | namespace trompeloeil { |
| 14 | template <> |
| 15 | inline void print(std::ostream& os, const leaf_data_& data) |
| 16 | { |
| 17 | os << leafDataToString(data); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | class MockDatastoreAccess : public trompeloeil::mock_interface<DatastoreAccess> { |
Václav Kubernát | d628291 | 2020-06-23 14:49:34 +0200 | [diff] [blame] | 22 | IMPLEMENT_CONST_MOCK1(getItems); |
Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 23 | IMPLEMENT_MOCK2(setLeaf); |
Jan Kundrát | cbf288b | 2020-06-18 20:44:39 +0200 | [diff] [blame] | 24 | IMPLEMENT_MOCK1(createItem); |
| 25 | IMPLEMENT_MOCK1(deleteItem); |
Václav Kubernát | bf65dd7 | 2020-05-28 02:32:31 +0200 | [diff] [blame] | 26 | IMPLEMENT_MOCK2(moveItem); |
Václav Kubernát | b3960f8 | 2020-12-01 03:21:48 +0100 | [diff] [blame] | 27 | IMPLEMENT_MOCK2(execute); |
Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 28 | |
| 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át | 7160a13 | 2020-04-03 02:11:01 +0200 | [diff] [blame] | 37 | IMPLEMENT_MOCK2(copyConfig); |
Václav Kubernát | 70d7f7a | 2020-06-23 14:40:40 +0200 | [diff] [blame] | 38 | IMPLEMENT_CONST_MOCK1(dump); |
Václav Kubernát | 43908fb | 2020-01-02 19:05:51 +0100 | [diff] [blame] | 39 | }; |