• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 
16 #include <gtest/gtest.h>
17 
18 #include "eventcenter/pasteboard_event.h"
19 
20 namespace OHOS::MiscServices {
21 using namespace testing::ext;
22 namespace {
23     const std::string NETWORK_ID = "networkId";
24 }
25 
26 class PasteboardEventTest : public testing::Test {
27 public:
28     static void SetUpTestCase();
29     static void TearDownTestCase();
30     void SetUp();
31     void TearDown();
32 };
33 
SetUpTestCase()34 void PasteboardEventTest::SetUpTestCase() {}
35 
TearDownTestCase()36 void PasteboardEventTest::TearDownTestCase() {}
37 
SetUp()38 void PasteboardEventTest::SetUp() {}
39 
TearDown()40 void PasteboardEventTest::TearDown() {}
41 
42 /**
43  * @tc.name: GetNetworkId_001
44  * @tc.desc: Verify that GetNetworkId returns the correct network ID.
45  * @tc.type: FUNC
46  */
47 HWTEST_F(PasteboardEventTest, GetNetworkId_001, TestSize.Level1)
48 {
49     int32_t evtId = 0;
50     PasteboardEvent pasteboardEvent(evtId, NETWORK_ID);
51     EXPECT_EQ(pasteboardEvent.GetNetworkId(), NETWORK_ID);
52 }
53 } // namespace OHOS::MiscServices
54