1 /* 2 * Copyright (c) 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 #include <string> 17 #include <vector> 18 #include "gtest/gtest.h" 19 #include "event_handler_factory.h" 20 #include "distributed_device_profile_constants.h" 21 22 namespace OHOS { 23 namespace DistributedDeviceProfile { 24 using namespace testing::ext; 25 using namespace std; 26 27 class EventHandlerFactoryTest : public testing::Test { 28 public: 29 static void SetUpTestCase(void); 30 static void TearDownTestCase(void); 31 void SetUp(); 32 void TearDown(); 33 }; 34 SetUpTestCase(void)35void EventHandlerFactoryTest::SetUpTestCase(void) { 36 } 37 TearDownTestCase(void)38void EventHandlerFactoryTest::TearDownTestCase(void) { 39 } 40 SetUp()41void EventHandlerFactoryTest::SetUp() { 42 } 43 TearDown()44void EventHandlerFactoryTest::TearDown() { 45 } 46 47 /** 48 * @tc.name: CreateEventHandler001 49 * @tc.desc: CreateEventHandler succeed and failed, handlerName is invalid. 50 * @tc.type: FUNC 51 * @tc.require: 52 */ 53 HWTEST_F(EventHandlerFactoryTest, CreateEventHandler001, TestSize.Level1) 54 { 55 auto eventHandler = EventHandlerFactory::GetInstance().GetEventHandler(); 56 EXPECT_EQ(nullptr, eventHandler); 57 } 58 } // namespace DistributedDeviceProfile 59 } // namespace OHOS 60