1 /*
2  * Copyright (c) 2022-2024 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 "del_white_list_infos_call_back_test.h"
17 
18 namespace OHOS {
19 namespace DistributedHardware {
20 namespace DistributedInput {
SetUp()21 void DelWhiteListInfosCallbackTest::SetUp()
22 {
23 }
24 
TearDown()25 void DelWhiteListInfosCallbackTest::TearDown()
26 {
27 }
28 
SetUpTestCase()29 void DelWhiteListInfosCallbackTest::SetUpTestCase()
30 {
31 }
32 
TearDownTestCase()33 void DelWhiteListInfosCallbackTest::TearDownTestCase()
34 {
35 }
36 
OnResult(const std::string & deviceId)37 void DelWhiteListInfosCallbackTest::TestDelWhiteListInfosCallbackStub::OnResult(const std::string &deviceId)
38 {
39     deviceId_ = deviceId;
40 }
41 
42 HWTEST_F(DelWhiteListInfosCallbackTest, DelWhiteListInfosCallback01, testing::ext::TestSize.Level1)
43 {
44     sptr<IRemoteObject> callBackStubPtr(new TestDelWhiteListInfosCallbackStub());
45     ASSERT_NE(nullptr, callBackStubPtr);
46     DelWhiteListInfosCallbackProxy callBackProxy(callBackStubPtr);
47     std::string deviceId = "deviceId0";
48     callBackProxy.OnResult(deviceId);
49     EXPECT_STREQ(deviceId.c_str(), ((sptr<TestDelWhiteListInfosCallbackStub> &)callBackStubPtr)->deviceId_.c_str());
50 }
51 } // namespace DistributedInput
52 } // namespace DistributedHardware
53 } // namespace OHOS