xref: /openbmc/google-ipmi-sys/test/file_system_mock.hpp (revision 15d4d21c091cd57a0e25888a8d360ba3a32965ff)
1*15d4d21cSHao Zhou // Copyright 2022 Google LLC
2*15d4d21cSHao Zhou //
3*15d4d21cSHao Zhou // Licensed under the Apache License, Version 2.0 (the "License");
4*15d4d21cSHao Zhou // you may not use this file except in compliance with the License.
5*15d4d21cSHao Zhou // You may obtain a copy of the License at
6*15d4d21cSHao Zhou //
7*15d4d21cSHao Zhou //      http://www.apache.org/licenses/LICENSE-2.0
8*15d4d21cSHao Zhou //
9*15d4d21cSHao Zhou // Unless required by applicable law or agreed to in writing, software
10*15d4d21cSHao Zhou // distributed under the License is distributed on an "AS IS" BASIS,
11*15d4d21cSHao Zhou // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*15d4d21cSHao Zhou // See the License for the specific language governing permissions and
13*15d4d21cSHao Zhou // limitations under the License.
14*15d4d21cSHao Zhou 
15*15d4d21cSHao Zhou #pragma once
16*15d4d21cSHao Zhou 
17*15d4d21cSHao Zhou #include "file_system_wrapper.hpp"
18*15d4d21cSHao Zhou 
19*15d4d21cSHao Zhou #include <gmock/gmock.h>
20*15d4d21cSHao Zhou 
21*15d4d21cSHao Zhou namespace google
22*15d4d21cSHao Zhou {
23*15d4d21cSHao Zhou namespace ipmi
24*15d4d21cSHao Zhou {
25*15d4d21cSHao Zhou namespace fs = std::filesystem;
26*15d4d21cSHao Zhou 
27*15d4d21cSHao Zhou class FileSystemMock : public FileSystemInterface
28*15d4d21cSHao Zhou {
29*15d4d21cSHao Zhou   public:
30*15d4d21cSHao Zhou     ~FileSystemMock() = default;
31*15d4d21cSHao Zhou 
32*15d4d21cSHao Zhou     MOCK_METHOD(bool, exists, (const fs::path&, std::error_code&),
33*15d4d21cSHao Zhou                 (const, override));
34*15d4d21cSHao Zhou     MOCK_METHOD(void, rename,
35*15d4d21cSHao Zhou                 (const fs::path&, const fs::path&, std::error_code&),
36*15d4d21cSHao Zhou                 (const, override));
37*15d4d21cSHao Zhou     MOCK_METHOD(void, create, (const char*), (const, override));
38*15d4d21cSHao Zhou };
39*15d4d21cSHao Zhou 
40*15d4d21cSHao Zhou } // namespace ipmi
41*15d4d21cSHao Zhou } // namespace google
42