/* * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #define private public #include "injection_event_dispatch.h" #undef private // head file namespace { using namespace testing::ext; using namespace OHOS::MMI; class InjectionEventDispatchTest : public testing::Test { public: static void SetUpTestCase(void) {} static void TearDownTestCase(void) {} }; HWTEST_F(InjectionEventDispatchTest, Test_Init, TestSize.Level1) { InjectionEventDispatch injectionEventDispatch; injectionEventDispatch.Init(); } HWTEST_F(InjectionEventDispatchTest, Test_OnJson, TestSize.Level1) { const std::string path = "/data/json/Test_InjectionEventDispatchTestOnJson.json"; InjectionEventDispatch injectionEventDispatch; injectionEventDispatch.injectArgvs_.push_back("json"); injectionEventDispatch.injectArgvs_.push_back(path); int32_t ret = injectionEventDispatch.OnJson(); EXPECT_EQ(ret, RET_ERR); } } // namespace