blob: 63e14c63dbf829b716df602a212801f87d2f27f8 [file] [log] [blame]
Kun Yi91beea62018-11-26 15:23:14 -08001#pragma once
2
Kun Yi68c81142018-12-18 11:17:14 -08003#include "binarystore_mock.hpp"
Kun Yi2765b642019-01-16 11:11:24 -08004#include "fake_sys_file.hpp"
Kun Yi91beea62018-11-26 15:23:14 -08005#include "handler.hpp"
6
Kun Yi64dc05c2018-12-19 13:19:03 -08007#include <memory>
8#include <string>
9
Kun Yi0a940b92019-01-07 16:33:11 -080010#include "binaryblob.pb.h"
11
Kun Yi91beea62018-11-26 15:23:14 -080012#include <gtest/gtest.h>
13
Kun Yi64dc05c2018-12-19 13:19:03 -080014using ::testing::Contains;
15
16using namespace std::string_literals;
Kun Yi2765b642019-01-16 11:11:24 -080017using namespace binstore;
Kun Yi64dc05c2018-12-19 13:19:03 -080018
Kun Yi91beea62018-11-26 15:23:14 -080019namespace blobs
20{
21
22class BinaryStoreBlobHandlerTest : public ::testing::Test
23{
24 protected:
25 BinaryStoreBlobHandlerTest() = default;
Kun Yi91beea62018-11-26 15:23:14 -080026
Kun Yi2765b642019-01-16 11:11:24 -080027 std::unique_ptr<MockBinaryStore> defaultMockStore(const std::string& baseId)
Kun Yi64dc05c2018-12-19 13:19:03 -080028 {
Kun Yi2765b642019-01-16 11:11:24 -080029 return std::make_unique<MockBinaryStore>(
Patrick Venturee496b2b2020-07-09 13:49:05 -070030 baseId, std::make_unique<FakeSysFile>());
Kun Yi64dc05c2018-12-19 13:19:03 -080031 }
32
33 void addDefaultStore(const std::string& baseId)
34 {
35 handler.addNewBinaryStore(defaultMockStore(baseId));
36 }
Kun Yi2765b642019-01-16 11:11:24 -080037
38 BinaryStoreBlobHandler handler;
Kun Yi38146a02018-12-18 21:54:26 -080039};
40
Kun Yi91beea62018-11-26 15:23:14 -080041} // namespace blobs