Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | fa06a5f | 2019-07-01 09:22:38 -0700 | [diff] [blame] | 3 | #include "firmware_handler.hpp" |
Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 4 | #include "status.hpp" |
| 5 | |
Patrick Venture | fa06a5f | 2019-07-01 09:22:38 -0700 | [diff] [blame] | 6 | #include <memory> |
| 7 | #include <string> |
| 8 | |
Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 9 | #include <gtest/gtest.h> |
| 10 | |
| 11 | namespace ipmi_flash |
| 12 | { |
| 13 | // TriggerableActionInterface |
| 14 | |
| 15 | class TriggerMock : public TriggerableActionInterface |
| 16 | { |
| 17 | public: |
| 18 | MOCK_METHOD0(trigger, bool()); |
| 19 | MOCK_METHOD0(abort, void()); |
| 20 | MOCK_METHOD0(status, ActionStatus()); |
| 21 | }; |
| 22 | |
| 23 | std::unique_ptr<TriggerableActionInterface> CreateTriggerMock() |
| 24 | { |
| 25 | return std::make_unique<TriggerMock>(); |
| 26 | } |
| 27 | |
Patrick Venture | fa06a5f | 2019-07-01 09:22:38 -0700 | [diff] [blame] | 28 | ActionMap CreateActionMap(const std::string& blobPath) |
| 29 | { |
| 30 | std::unique_ptr<ActionPack> actionPack = std::make_unique<ActionPack>(); |
| 31 | actionPack->preparation = std::move(CreateTriggerMock()); |
| 32 | actionPack->verification = std::move(CreateTriggerMock()); |
| 33 | actionPack->update = std::move(CreateTriggerMock()); |
| 34 | |
| 35 | ActionMap map; |
| 36 | map[blobPath] = std::move(actionPack); |
| 37 | return map; |
| 38 | } |
| 39 | |
Patrick Venture | 1d66fe6 | 2019-06-03 14:57:27 -0700 | [diff] [blame] | 40 | } // namespace ipmi_flash |