blob: 1d4f726a6988e5ad05e0b4d29609b32f0b7bcc67 [file] [log] [blame]
#pragma once
#include "image_handler.hpp"
#include <memory>
#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());
};
std::unique_ptr<ImageHandlerMock> CreateImageMock()
{
return std::make_unique<ImageHandlerMock>();
}
} // namespace ipmi_flash