1 /* 2 * Copyright (c) 2022-2025 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 #ifndef OHOS_UTTEST_DM_SERVICE_H 16 #define OHOS_UTTEST_DM_SERVICE_H 17 18 #include <gtest/gtest.h> 19 #include <memory> 20 #include <refbase.h> 21 22 #include <string> 23 #include <vector> 24 25 #include "app_manager_mock.h" 26 #include "common_event_support.h" 27 #include "device_manager_service.h" 28 #include "device_manager_service_listener.h" 29 #include "device_manager_service_impl_mock.h" 30 #include "device_name_manager_mock.h" 31 #include "deviceprofile_connector_mock.h" 32 #include "dm_comm_tool_mock.h" 33 #include "dm_crypto_mock.h" 34 #include "dm_single_instance.h" 35 #include "dm_softbus_cache_mock.h" 36 #include "kv_adapter_manager_mock.h" 37 #include "multiple_user_connector_mock.h" 38 #include "permission_manager_mock.h" 39 #include "softbus_listener_mock.h" 40 41 namespace OHOS { 42 namespace DistributedHardware { 43 class DeviceManagerServiceTest : public testing::Test { 44 public: 45 static void SetUpTestCase(); 46 static void TearDownTestCase(); 47 void SetUp(); 48 void TearDown(); 49 50 static inline std::shared_ptr<PermissionManagerMock> permissionManagerMock_ = 51 std::make_shared<PermissionManagerMock>(); 52 static inline std::shared_ptr<SoftbusListenerMock> softbusListenerMock_ = 53 std::make_shared<SoftbusListenerMock>(); 54 static inline std::shared_ptr<AppManagerMock> appManagerMock_ = 55 std::make_shared<AppManagerMock>(); 56 static inline std::shared_ptr<KVAdapterManagerMock> kVAdapterManagerMock_ = 57 std::make_shared<KVAdapterManagerMock>(); 58 static inline std::shared_ptr<DeviceManagerServiceImplMock> deviceManagerServiceImplMock_ = 59 std::make_shared<DeviceManagerServiceImplMock>(); 60 static inline std::shared_ptr<SoftbusCacheMock> softbusCacheMock_ = 61 std::make_shared<SoftbusCacheMock>(); 62 static inline std::shared_ptr<CryptoMock> cryptoMock_ = std::make_shared<CryptoMock>(); 63 static inline std::shared_ptr<MultipleUserConnectorMock> multipleUserConnectorMock_ = 64 std::make_shared<MultipleUserConnectorMock>(); 65 static inline std::shared_ptr<DMCommToolMock> dMCommToolMock_ = std::make_shared<DMCommToolMock>(); 66 static inline std::shared_ptr<DeviceProfileConnectorMock> deviceProfileConnectorMock_ = 67 std::make_shared<DeviceProfileConnectorMock>(); 68 static inline std::shared_ptr<DeviceNameManagerMock> deviceNameManagerMock_ = 69 std::make_shared<DeviceNameManagerMock>(); 70 }; 71 } // namespace DistributedHardware 72 } // namespace OHOS 73 #endif 74