test: move shared mocks to common area

Move mocks that can be shared between version and firmware handler tests
to parent directory (bmc/test).

This will eliminate the need to duplicate the definition of testing
mocks.

Signed-off-by: Jason Ling <jasonling@google.com>
Change-Id: Id41c56271d0bfbcb8c18da1f903c7786699508d4
diff --git a/bmc/test/image_mock.hpp b/bmc/test/image_mock.hpp
new file mode 100644
index 0000000..2a967ac
--- /dev/null
+++ b/bmc/test/image_mock.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "image_handler.hpp"
+
+#include <gmock/gmock.h>
+
+namespace ipmi_flash
+{
+
+class ImageHandlerMock : public ImageHandlerInterface
+{
+  public:
+    virtual ~ImageHandlerMock() = default;
+    MOCK_METHOD2(open, bool(const std::string&, std::ios_base::openmode));
+    MOCK_METHOD0(close, void());
+    MOCK_METHOD2(write, bool(std::uint32_t, const std::vector<std::uint8_t>&));
+    MOCK_METHOD2(read, std::optional<std::vector<std::uint8_t>>(std::uint32_t,
+                                                                std::uint32_t));
+    MOCK_METHOD0(getSize, int());
+};
+
+} // namespace ipmi_flash
diff --git a/bmc/test/triggerable_mock.hpp b/bmc/test/triggerable_mock.hpp
new file mode 100644
index 0000000..9a63dcb
--- /dev/null
+++ b/bmc/test/triggerable_mock.hpp
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "status.hpp"
+
+#include <memory>
+#include <string>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+namespace ipmi_flash
+{
+// TriggerableActionInterface
+
+class TriggerMock : public TriggerableActionInterface
+{
+  public:
+    MOCK_METHOD0(trigger, bool());
+    MOCK_METHOD0(abort, void());
+    MOCK_METHOD0(status, ActionStatus());
+};
+
+std::unique_ptr<TriggerableActionInterface> CreateTriggerMock()
+{
+    return std::make_unique<TriggerMock>();
+}
+
+} // namespace ipmi_flash