• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef EDM_UNIT_TEST_DEVICE_INFO_PLUGIN_TEST_H
17 #define EDM_UNIT_TEST_DEVICE_INFO_PLUGIN_TEST_H
18 
19 #include <gmock/gmock.h>
20 #include <gtest/gtest.h>
21 #include <memory>
22 
23 #include "edm_os_account_manager_impl_mock.h"
24 #include "external_manager_factory_mock.h"
25 #include "get_device_info_plugin.h"
26 #include "iplugin_manager.h"
27 
28 namespace OHOS {
29 namespace EDM {
30 namespace TEST {
31 class GetDeviceInfoPluginMock : public GetDeviceInfoPlugin {
32 public:
33     MOCK_METHOD(std::shared_ptr<IExternalManagerFactory>, GetExternalManagerFactory, (), (override));
34 };
35 
36 class DeviceInfoPluginTest : public testing::Test {
37 protected:
38     static void SetUpTestSuite(void);
39     static void TearDownTestSuite(void);
40     std::shared_ptr<IPlugin> plugin_;
41     std::shared_ptr<GetDeviceInfoPluginMock> pluginMock_ = std::make_shared<GetDeviceInfoPluginMock>();
42     std::shared_ptr<EdmOsAccountManagerImplMock> osAccountMgrMock_ = std::make_shared<EdmOsAccountManagerImplMock>();
43     std::shared_ptr<ExternalManagerFactoryMock> factoryMock_ = std::make_shared<ExternalManagerFactoryMock>();
44 };
45 } // namespace TEST
46 } // namespace EDM
47 } // namespace OHOS
48 #endif // EDM_UNIT_TEST_DEVICE_INFO_PLUGIN_TEST_H