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 #ifndef OHOS_WIFI_EVENT_HANDLER_TEST 16 #define OHOS_WIFI_EVENT_HANDLER_TEST 17 18 #include <gtest/gtest.h> 19 #include "wifi_event_handler.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 class WifiEventHandlerTest : public testing::Test { 24 public: SetUpTestCase()25 static void SetUpTestCase() {} TearDownTestCase()26 static void TearDownTestCase() {} 27 SetUp()28 virtual void SetUp() 29 { 30 testEventHandler = std::make_unique<WifiEventHandler>("WifiEventHandlerTest"); 31 result = 0; 32 } 33 TearDown()34 virtual void TearDown() 35 { 36 if (testEventHandler) { 37 testEventHandler.reset(); 38 } 39 } 40 EventHandlerCallback()41 static void EventHandlerCallback() { result = 1; } 42 public: 43 static int result; 44 std::unique_ptr<WifiEventHandler> testEventHandler = nullptr; 45 }; 46 } // namespace Wifi 47 } // namespace OHOS 48 #endif