Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 1 | #pragma once |
2 | |||||
Kun Yi | 68c8114 | 2018-12-18 11:17:14 -0800 | [diff] [blame] | 3 | #include "binarystore_mock.hpp" |
Kun Yi | 2765b64 | 2019-01-16 11:11:24 -0800 | [diff] [blame] | 4 | #include "fake_sys_file.hpp" |
Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 5 | #include "handler.hpp" |
6 | |||||
Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame] | 7 | #include <memory> |
8 | #include <string> | ||||
9 | |||||
Kun Yi | 0a940b9 | 2019-01-07 16:33:11 -0800 | [diff] [blame] | 10 | #include "binaryblob.pb.h" |
11 | |||||
Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 12 | #include <gtest/gtest.h> |
13 | |||||
Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame] | 14 | using ::testing::Contains; |
15 | |||||
16 | using namespace std::string_literals; | ||||
Kun Yi | 2765b64 | 2019-01-16 11:11:24 -0800 | [diff] [blame] | 17 | using namespace binstore; |
Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame] | 18 | |
Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 19 | namespace blobs |
20 | { | ||||
21 | |||||
22 | class BinaryStoreBlobHandlerTest : public ::testing::Test | ||||
23 | { | ||||
24 | protected: | ||||
25 | BinaryStoreBlobHandlerTest() = default; | ||||
Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 26 | |
Kun Yi | 2765b64 | 2019-01-16 11:11:24 -0800 | [diff] [blame] | 27 | std::unique_ptr<MockBinaryStore> defaultMockStore(const std::string& baseId) |
Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame] | 28 | { |
Kun Yi | 2765b64 | 2019-01-16 11:11:24 -0800 | [diff] [blame] | 29 | return std::make_unique<MockBinaryStore>( |
Patrick Venture | e496b2b | 2020-07-09 13:49:05 -0700 | [diff] [blame] | 30 | baseId, std::make_unique<FakeSysFile>()); |
Kun Yi | 64dc05c | 2018-12-19 13:19:03 -0800 | [diff] [blame] | 31 | } |
32 | |||||
33 | void addDefaultStore(const std::string& baseId) | ||||
34 | { | ||||
35 | handler.addNewBinaryStore(defaultMockStore(baseId)); | ||||
36 | } | ||||
Kun Yi | 2765b64 | 2019-01-16 11:11:24 -0800 | [diff] [blame] | 37 | |
38 | BinaryStoreBlobHandler handler; | ||||
Kun Yi | 38146a0 | 2018-12-18 21:54:26 -0800 | [diff] [blame] | 39 | }; |
40 | |||||
Kun Yi | 91beea6 | 2018-11-26 15:23:14 -0800 | [diff] [blame] | 41 | } // namespace blobs |