1d95e75fdSopenharmony_ci/*
2d95e75fdSopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd.
3d95e75fdSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4d95e75fdSopenharmony_ci * you may not use this file except in compliance with the License.
5d95e75fdSopenharmony_ci * You may obtain a copy of the License at
6d95e75fdSopenharmony_ci *
7d95e75fdSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8d95e75fdSopenharmony_ci *
9d95e75fdSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10d95e75fdSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11d95e75fdSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12d95e75fdSopenharmony_ci * See the License for the specific language governing permissions and
13d95e75fdSopenharmony_ci * limitations under the License.
14d95e75fdSopenharmony_ci */
15d95e75fdSopenharmony_ci
16d95e75fdSopenharmony_ci#define private public
17d95e75fdSopenharmony_ci#define protected public
18d95e75fdSopenharmony_ci
19d95e75fdSopenharmony_ci#include "gtest/gtest.h"
20d95e75fdSopenharmony_ci#include "cellular_call_connection_ims.h"
21d95e75fdSopenharmony_ci#include "cellular_call_connection_satellite.h"
22d95e75fdSopenharmony_ci#include "call_manager_base.h"
23d95e75fdSopenharmony_ci#include "cellular_call_service.h"
24d95e75fdSopenharmony_ci
25d95e75fdSopenharmony_cinamespace OHOS {
26d95e75fdSopenharmony_cinamespace Telephony {
27d95e75fdSopenharmony_ciusing namespace testing::ext;
28d95e75fdSopenharmony_ciclass ImsConnectionTest : public testing::Test {
29d95e75fdSopenharmony_cipublic:
30d95e75fdSopenharmony_ci    static void SetUpTestCase();
31d95e75fdSopenharmony_ci    static void TearDownTestCase();
32d95e75fdSopenharmony_ci    void SetUp();
33d95e75fdSopenharmony_ci    void TearDown();
34d95e75fdSopenharmony_ci};
35d95e75fdSopenharmony_civoid ImsConnectionTest::SetUpTestCase() {}
36d95e75fdSopenharmony_ci
37d95e75fdSopenharmony_civoid ImsConnectionTest::TearDownTestCase() {}
38d95e75fdSopenharmony_ci
39d95e75fdSopenharmony_civoid ImsConnectionTest::SetUp() {}
40d95e75fdSopenharmony_ci
41d95e75fdSopenharmony_civoid ImsConnectionTest::TearDown() {}
42d95e75fdSopenharmony_ci/**
43d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0001
44d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
45d95e75fdSopenharmony_ci * @tc.desc     Function test
46d95e75fdSopenharmony_ci */
47d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0001, Function | MediumTest | Level1)
48d95e75fdSopenharmony_ci{
49d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
50d95e75fdSopenharmony_ci    int32_t slotId = 0;
51d95e75fdSopenharmony_ci    std::string phoneNum;
52d95e75fdSopenharmony_ci    int32_t index = 0;
53d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->HangUpRequest(slotId, phoneNum, index);
54d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
55d95e75fdSopenharmony_ci}
56d95e75fdSopenharmony_ci
57d95e75fdSopenharmony_ci/**
58d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0002
59d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
60d95e75fdSopenharmony_ci * @tc.desc     Function test
61d95e75fdSopenharmony_ci */
62d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0002, Function | MediumTest | Level1)
63d95e75fdSopenharmony_ci{
64d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
65d95e75fdSopenharmony_ci    int32_t slotId = 0;
66d95e75fdSopenharmony_ci    std::string phoneNum;
67d95e75fdSopenharmony_ci    int32_t index = 0;
68d95e75fdSopenharmony_ci    int32_t videoState = 0;
69d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->AnswerRequest(slotId, phoneNum, videoState, index);
70d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
71d95e75fdSopenharmony_ci}
72d95e75fdSopenharmony_ci
73d95e75fdSopenharmony_ci/**
74d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0003
75d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
76d95e75fdSopenharmony_ci * @tc.desc     Function test
77d95e75fdSopenharmony_ci */
78d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0003, Function | MediumTest | Level1)
79d95e75fdSopenharmony_ci{
80d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
81d95e75fdSopenharmony_ci    int32_t slotId = 0;
82d95e75fdSopenharmony_ci    std::string phoneNum;
83d95e75fdSopenharmony_ci    int32_t index = 0;
84d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->RejectRequest(slotId, phoneNum, index);
85d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
86d95e75fdSopenharmony_ci}
87d95e75fdSopenharmony_ci
88d95e75fdSopenharmony_ci/**
89d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0004
90d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
91d95e75fdSopenharmony_ci * @tc.desc     Function test
92d95e75fdSopenharmony_ci */
93d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0004, Function | MediumTest | Level1)
94d95e75fdSopenharmony_ci{
95d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
96d95e75fdSopenharmony_ci    int32_t slotId = 0;
97d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->HoldCallRequest(slotId);
98d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
99d95e75fdSopenharmony_ci}
100d95e75fdSopenharmony_ci
101d95e75fdSopenharmony_ci/**
102d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0005
103d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
104d95e75fdSopenharmony_ci * @tc.desc     Function test
105d95e75fdSopenharmony_ci */
106d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0005, Function | MediumTest | Level1)
107d95e75fdSopenharmony_ci{
108d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
109d95e75fdSopenharmony_ci    int32_t slotId = 0;
110d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->UnHoldCallRequest(slotId);
111d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
112d95e75fdSopenharmony_ci}
113d95e75fdSopenharmony_ci
114d95e75fdSopenharmony_ci/**
115d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0006
116d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
117d95e75fdSopenharmony_ci * @tc.desc     Function test
118d95e75fdSopenharmony_ci */
119d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0006, Function | MediumTest | Level1)
120d95e75fdSopenharmony_ci{
121d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
122d95e75fdSopenharmony_ci    int32_t slotId = 0;
123d95e75fdSopenharmony_ci    int32_t voiceCall = 0;
124d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->CombineConferenceRequest(slotId, voiceCall);
125d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
126d95e75fdSopenharmony_ci}
127d95e75fdSopenharmony_ci
128d95e75fdSopenharmony_ci/**
129d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0007
130d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
131d95e75fdSopenharmony_ci * @tc.desc     Function test
132d95e75fdSopenharmony_ci */
133d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0007, Function | MediumTest | Level1)
134d95e75fdSopenharmony_ci{
135d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
136d95e75fdSopenharmony_ci    int32_t slotId = 0;
137d95e75fdSopenharmony_ci    std::vector<std::string> numberList;
138d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->InviteToConferenceRequest(slotId, numberList);
139d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
140d95e75fdSopenharmony_ci}
141d95e75fdSopenharmony_ci
142d95e75fdSopenharmony_ci/**
143d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0008
144d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
145d95e75fdSopenharmony_ci * @tc.desc     Function test
146d95e75fdSopenharmony_ci */
147d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0008, Function | MediumTest | Level1)
148d95e75fdSopenharmony_ci{
149d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
150d95e75fdSopenharmony_ci    int32_t slotId = 0;
151d95e75fdSopenharmony_ci    int32_t index = 0;
152d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->KickOutFromConferenceRequest(slotId, index);
153d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
154d95e75fdSopenharmony_ci}
155d95e75fdSopenharmony_ci
156d95e75fdSopenharmony_ci/**
157d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0009
158d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
159d95e75fdSopenharmony_ci * @tc.desc     Function test
160d95e75fdSopenharmony_ci */
161d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0009, Function | MediumTest | Level1)
162d95e75fdSopenharmony_ci{
163d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
164d95e75fdSopenharmony_ci    int32_t slotId = 0;
165d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->SwitchCallRequest(slotId);
166d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
167d95e75fdSopenharmony_ci}
168d95e75fdSopenharmony_ci
169d95e75fdSopenharmony_ci/**
170d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0010
171d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
172d95e75fdSopenharmony_ci * @tc.desc     Function test
173d95e75fdSopenharmony_ci */
174d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0010, Function | MediumTest | Level1)
175d95e75fdSopenharmony_ci{
176d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
177d95e75fdSopenharmony_ci    int32_t slotId = 0;
178d95e75fdSopenharmony_ci    int64_t lastCallsDataFlag = 0;
179d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->GetImsCallsDataRequest(slotId, lastCallsDataFlag);
180d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
181d95e75fdSopenharmony_ci}
182d95e75fdSopenharmony_ci
183d95e75fdSopenharmony_ci/**
184d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0011
185d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
186d95e75fdSopenharmony_ci * @tc.desc     Function test
187d95e75fdSopenharmony_ci */
188d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0011, Function | MediumTest | Level1)
189d95e75fdSopenharmony_ci{
190d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
191d95e75fdSopenharmony_ci    int32_t slotId = 0;
192d95e75fdSopenharmony_ci    int32_t lastCallsDataFlag = 0;
193d95e75fdSopenharmony_ci    char cDtmfCode = 0;
194d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->SendDtmfRequest(slotId, cDtmfCode, lastCallsDataFlag);
195d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
196d95e75fdSopenharmony_ci}
197d95e75fdSopenharmony_ci
198d95e75fdSopenharmony_ci/**
199d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0012
200d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
201d95e75fdSopenharmony_ci * @tc.desc     Function test
202d95e75fdSopenharmony_ci */
203d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0012, Function | MediumTest | Level1)
204d95e75fdSopenharmony_ci{
205d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
206d95e75fdSopenharmony_ci    int32_t slotId = 0;
207d95e75fdSopenharmony_ci    int32_t lastCallsDataFlag = 0;
208d95e75fdSopenharmony_ci    char cDtmfCode = 0;
209d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->StartDtmfRequest(slotId, cDtmfCode, lastCallsDataFlag);
210d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
211d95e75fdSopenharmony_ci}
212d95e75fdSopenharmony_ci
213d95e75fdSopenharmony_ci/**
214d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0013
215d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
216d95e75fdSopenharmony_ci * @tc.desc     Function test
217d95e75fdSopenharmony_ci */
218d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0013, Function | MediumTest | Level1)
219d95e75fdSopenharmony_ci{
220d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
221d95e75fdSopenharmony_ci    int32_t slotId = 0;
222d95e75fdSopenharmony_ci    int32_t index = 0;
223d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->StopDtmfRequest(slotId, index);
224d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
225d95e75fdSopenharmony_ci}
226d95e75fdSopenharmony_ci
227d95e75fdSopenharmony_ci/**
228d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0014
229d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
230d95e75fdSopenharmony_ci * @tc.desc     Function test
231d95e75fdSopenharmony_ci */
232d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0014, Function | MediumTest | Level1)
233d95e75fdSopenharmony_ci{
234d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
235d95e75fdSopenharmony_ci    int32_t slotId = 0;
236d95e75fdSopenharmony_ci    std::string msg;
237d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->StartRttRequest(slotId, msg);
238d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
239d95e75fdSopenharmony_ci}
240d95e75fdSopenharmony_ci
241d95e75fdSopenharmony_ci/**
242d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0015
243d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
244d95e75fdSopenharmony_ci * @tc.desc     Function test
245d95e75fdSopenharmony_ci */
246d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0015, Function | MediumTest | Level1)
247d95e75fdSopenharmony_ci{
248d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
249d95e75fdSopenharmony_ci    int32_t slotId = 0;
250d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->StopRttRequest(slotId);
251d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
252d95e75fdSopenharmony_ci}
253d95e75fdSopenharmony_ci
254d95e75fdSopenharmony_ci/**
255d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0016
256d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
257d95e75fdSopenharmony_ci * @tc.desc     Function test
258d95e75fdSopenharmony_ci */
259d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0016, Function | MediumTest | Level1)
260d95e75fdSopenharmony_ci{
261d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
262d95e75fdSopenharmony_ci    int32_t slotId = 0;
263d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->GetCallFailReasonRequest(slotId);
264d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_ERROR);
265d95e75fdSopenharmony_ci}
266d95e75fdSopenharmony_ci
267d95e75fdSopenharmony_ci/**
268d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0017
269d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
270d95e75fdSopenharmony_ci * @tc.desc     Function test
271d95e75fdSopenharmony_ci */
272d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0017, Function | MediumTest | Level1)
273d95e75fdSopenharmony_ci{
274d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
275d95e75fdSopenharmony_ci    int32_t slotId = 0;
276d95e75fdSopenharmony_ci    char c = 0;
277d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionIMS->ProcessPostDialCallChar(slotId, c);
278d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_SUCCESS);
279d95e75fdSopenharmony_ci}
280d95e75fdSopenharmony_ci
281d95e75fdSopenharmony_ci/**
282d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0018
283d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
284d95e75fdSopenharmony_ci * @tc.desc     Function test
285d95e75fdSopenharmony_ci */
286d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0018, Function | MediumTest | Level1)
287d95e75fdSopenharmony_ci{
288d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
289d95e75fdSopenharmony_ci    EXPECT_FALSE(cellularCallConnectionIMS->IsNeedToDial());
290d95e75fdSopenharmony_ci}
291d95e75fdSopenharmony_ci
292d95e75fdSopenharmony_ci/**
293d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0019
294d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
295d95e75fdSopenharmony_ci * @tc.desc     Function test
296d95e75fdSopenharmony_ci */
297d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0019, Function | MediumTest | Level1)
298d95e75fdSopenharmony_ci{
299d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
300d95e75fdSopenharmony_ci    bool isNeedToDial = false;
301d95e75fdSopenharmony_ci    cellularCallConnectionIMS->SetDialFlag(isNeedToDial);
302d95e75fdSopenharmony_ci    EXPECT_EQ(cellularCallConnectionIMS->isNeedToDial_, 0);
303d95e75fdSopenharmony_ci}
304d95e75fdSopenharmony_ci
305d95e75fdSopenharmony_ci/**
306d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionIMSTest_0021
307d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionIMS
308d95e75fdSopenharmony_ci * @tc.desc     Function test
309d95e75fdSopenharmony_ci */
310d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionIMSTest_0021, Function | MediumTest | Level1)
311d95e75fdSopenharmony_ci{
312d95e75fdSopenharmony_ci    auto cellularCallConnectionIMS = std::make_shared<CellularCallConnectionIMS>();
313d95e75fdSopenharmony_ci    EXPECT_FALSE(cellularCallConnectionIMS->IsPendingHold());
314d95e75fdSopenharmony_ci}
315d95e75fdSopenharmony_ci
316d95e75fdSopenharmony_ci/**
317d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionSatelliteTest_0001
318d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionSatellite
319d95e75fdSopenharmony_ci * @tc.desc     Function test
320d95e75fdSopenharmony_ci */
321d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionSatelliteTest_0001, Function | MediumTest | Level1)
322d95e75fdSopenharmony_ci{
323d95e75fdSopenharmony_ci    auto cellularCallconnerctionSatellite = std::make_shared<CellularCallConnectionSatellite>();
324d95e75fdSopenharmony_ci    int32_t slotId = 0;
325d95e75fdSopenharmony_ci    int32_t index = 0;
326d95e75fdSopenharmony_ci    int32_t ret = cellularCallconnerctionSatellite->SendDtmfRequest(slotId, '1', index);
327d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_ERROR);
328d95e75fdSopenharmony_ci}
329d95e75fdSopenharmony_ci
330d95e75fdSopenharmony_ci/**
331d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionSatelliteTest_0002
332d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionSatellite
333d95e75fdSopenharmony_ci * @tc.desc     Function test
334d95e75fdSopenharmony_ci */
335d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionSatelliteTest_0002, Function | MediumTest | Level1)
336d95e75fdSopenharmony_ci{
337d95e75fdSopenharmony_ci    auto cellularCallconnerctionSatellite = std::make_shared<CellularCallConnectionSatellite>();
338d95e75fdSopenharmony_ci    int32_t slotId = 0;
339d95e75fdSopenharmony_ci    int32_t index = 0;
340d95e75fdSopenharmony_ci    int32_t ret = cellularCallconnerctionSatellite->SendDtmfRequest(slotId, '1', index);
341d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_ERROR);
342d95e75fdSopenharmony_ci    auto handle = DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId);
343d95e75fdSopenharmony_ci    EXPECT_EQ(handle, nullptr);
344d95e75fdSopenharmony_ci}
345d95e75fdSopenharmony_ci
346d95e75fdSopenharmony_ci/**
347d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionSatelliteTest_0003
348d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionSatellite
349d95e75fdSopenharmony_ci * @tc.desc     Function test
350d95e75fdSopenharmony_ci */
351d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionSatelliteTest_0003, Function | MediumTest | Level1)
352d95e75fdSopenharmony_ci{
353d95e75fdSopenharmony_ci    auto cellularCallconnerctionSatellite = std::make_shared<CellularCallConnectionSatellite>();
354d95e75fdSopenharmony_ci    int32_t slotId = 0;
355d95e75fdSopenharmony_ci    int32_t index = 0;
356d95e75fdSopenharmony_ci    int32_t ret = cellularCallconnerctionSatellite->StartDtmfRequest(slotId, '1', index);
357d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_ERROR);
358d95e75fdSopenharmony_ci
359d95e75fdSopenharmony_ci    auto handle = DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId);
360d95e75fdSopenharmony_ci    EXPECT_EQ(handle, nullptr);
361d95e75fdSopenharmony_ci}
362d95e75fdSopenharmony_ci
363d95e75fdSopenharmony_ci/**
364d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionSatelliteTest_0004
365d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionSatellite
366d95e75fdSopenharmony_ci * @tc.desc     Function test
367d95e75fdSopenharmony_ci */
368d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionSatelliteTest_0004, Function | MediumTest | Level1)
369d95e75fdSopenharmony_ci{
370d95e75fdSopenharmony_ci    auto cellularCallconnerctionSatellite = std::make_shared<CellularCallConnectionSatellite>();
371d95e75fdSopenharmony_ci    int32_t slotId = 0;
372d95e75fdSopenharmony_ci    int32_t index = 0;
373d95e75fdSopenharmony_ci    int32_t ret = cellularCallconnerctionSatellite->StopDtmfRequest(slotId, index);
374d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_ERROR);
375d95e75fdSopenharmony_ci
376d95e75fdSopenharmony_ci    auto handle = DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId);
377d95e75fdSopenharmony_ci    EXPECT_EQ(handle, nullptr);
378d95e75fdSopenharmony_ci}
379d95e75fdSopenharmony_ci
380d95e75fdSopenharmony_ci/**
381d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionSatelliteTest_0005
382d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionSatellite
383d95e75fdSopenharmony_ci * @tc.desc     Function test
384d95e75fdSopenharmony_ci */
385d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionSatelliteTest_0005, Function | MediumTest | Level1)
386d95e75fdSopenharmony_ci{
387d95e75fdSopenharmony_ci    auto cellularCallconnerctionSatellite = std::make_shared<CellularCallConnectionSatellite>();
388d95e75fdSopenharmony_ci    int32_t slotId = 0;
389d95e75fdSopenharmony_ci    int32_t ret = cellularCallconnerctionSatellite->ProcessPostDialCallChar(slotId, '1');
390d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_SUCCESS);
391d95e75fdSopenharmony_ci
392d95e75fdSopenharmony_ci    auto handle = DelayedSingleton<CellularCallService>::GetInstance()->GetHandler(slotId);
393d95e75fdSopenharmony_ci    EXPECT_EQ(handle, nullptr);
394d95e75fdSopenharmony_ci}
395d95e75fdSopenharmony_ci
396d95e75fdSopenharmony_ci/**
397d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0001
398d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
399d95e75fdSopenharmony_ci * @tc.desc     Function test GetState
400d95e75fdSopenharmony_ci */
401d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0001, Function | MediumTest | Level1)
402d95e75fdSopenharmony_ci{
403d95e75fdSopenharmony_ci    BaseConnection baseConnection;
404d95e75fdSopenharmony_ci    baseConnection.SetStatus(TelCallState::CALL_STATUS_DIALING);
405d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetStatus(), TelCallState::CALL_STATUS_DIALING);
406d95e75fdSopenharmony_ci}
407d95e75fdSopenharmony_ci
408d95e75fdSopenharmony_ci/**
409d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0002
410d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
411d95e75fdSopenharmony_ci * @tc.desc     Function test IsRingingState
412d95e75fdSopenharmony_ci */
413d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0002, Function | MediumTest | Level1)
414d95e75fdSopenharmony_ci{
415d95e75fdSopenharmony_ci    BaseConnection baseConnection;
416d95e75fdSopenharmony_ci    baseConnection.SetStatus(TelCallState::CALL_STATUS_DIALING);
417d95e75fdSopenharmony_ci    EXPECT_FALSE(baseConnection.IsRingingState());
418d95e75fdSopenharmony_ci
419d95e75fdSopenharmony_ci    baseConnection.SetStatus(TelCallState::CALL_STATUS_WAITING);
420d95e75fdSopenharmony_ci    EXPECT_TRUE(baseConnection.IsRingingState());
421d95e75fdSopenharmony_ci
422d95e75fdSopenharmony_ci    baseConnection.SetStatus(TelCallState::CALL_STATUS_ALERTING);
423d95e75fdSopenharmony_ci    EXPECT_TRUE(baseConnection.IsRingingState());
424d95e75fdSopenharmony_ci}
425d95e75fdSopenharmony_ci
426d95e75fdSopenharmony_ci/**
427d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0003
428d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
429d95e75fdSopenharmony_ci * @tc.desc     Function test GetFlag and SetFlag
430d95e75fdSopenharmony_ci */
431d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0003, Function | MediumTest | Level1)
432d95e75fdSopenharmony_ci{
433d95e75fdSopenharmony_ci    BaseConnection baseConnection;
434d95e75fdSopenharmony_ci    baseConnection.SetFlag(true);
435d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetFlag(), true);
436d95e75fdSopenharmony_ci}
437d95e75fdSopenharmony_ci
438d95e75fdSopenharmony_ci/**
439d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0004
440d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
441d95e75fdSopenharmony_ci * @tc.desc     Function test GetNumber
442d95e75fdSopenharmony_ci */
443d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0004, Function | MediumTest | Level1)
444d95e75fdSopenharmony_ci{
445d95e75fdSopenharmony_ci    BaseConnection baseConnection;
446d95e75fdSopenharmony_ci    baseConnection.SetNumber("1234567890");
447d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetNumber(), "1234567890");
448d95e75fdSopenharmony_ci}
449d95e75fdSopenharmony_ci
450d95e75fdSopenharmony_ci/**
451d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0005
452d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
453d95e75fdSopenharmony_ci * @tc.desc     Function test GetNumber
454d95e75fdSopenharmony_ci */
455d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0005, Function | MediumTest | Level1)
456d95e75fdSopenharmony_ci{
457d95e75fdSopenharmony_ci    BaseConnection baseConnection;
458d95e75fdSopenharmony_ci    baseConnection.SetNumber("1234567890");
459d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetNumber(), "1234567890");
460d95e75fdSopenharmony_ci}
461d95e75fdSopenharmony_ci
462d95e75fdSopenharmony_ci/**
463d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0006
464d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
465d95e75fdSopenharmony_ci * @tc.desc     Function test UpdatePendingHoldFlag
466d95e75fdSopenharmony_ci */
467d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0006, Function | MediumTest | Level1)
468d95e75fdSopenharmony_ci{
469d95e75fdSopenharmony_ci    BaseConnection baseConnection;
470d95e75fdSopenharmony_ci    baseConnection.UpdatePendingHoldFlag(true);
471d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetCallReportInfo().isPendingHold, true);
472d95e75fdSopenharmony_ci}
473d95e75fdSopenharmony_ci
474d95e75fdSopenharmony_ci/**
475d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0007
476d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
477d95e75fdSopenharmony_ci * @tc.desc     Function test ProcessPostDialCallChar
478d95e75fdSopenharmony_ci */
479d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0007, Function | MediumTest | Level1)
480d95e75fdSopenharmony_ci{
481d95e75fdSopenharmony_ci    BaseConnection baseConnection;
482d95e75fdSopenharmony_ci    int32_t slotId = 0;
483d95e75fdSopenharmony_ci    char c = 'B';
484d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.ProcessPostDialCallChar(slotId, c), TELEPHONY_SUCCESS);
485d95e75fdSopenharmony_ci}
486d95e75fdSopenharmony_ci
487d95e75fdSopenharmony_ci/**
488d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0008
489d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
490d95e75fdSopenharmony_ci * @tc.desc     Function test GetLeftPostDialCallString
491d95e75fdSopenharmony_ci */
492d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0008, Function | MediumTest | Level1)
493d95e75fdSopenharmony_ci{
494d95e75fdSopenharmony_ci    BaseConnection baseConnection;
495d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.GetLeftPostDialCallString(), "");
496d95e75fdSopenharmony_ci
497d95e75fdSopenharmony_ci    baseConnection.SetPostDialCallState(PostDialCallState::POST_DIAL_CALL_NOT_STARTED);
498d95e75fdSopenharmony_ci    std::string phoneString = "13363669099,123321";
499d95e75fdSopenharmony_ci    baseConnection.UpdateCallNumber(phoneString);
500d95e75fdSopenharmony_ci    EXPECT_NE(baseConnection.GetLeftPostDialCallString(), "13363669099");
501d95e75fdSopenharmony_ci}
502d95e75fdSopenharmony_ci
503d95e75fdSopenharmony_ci/**
504d95e75fdSopenharmony_ci * @tc.number   Telephony_ImsBaseConnectionTest_0009
505d95e75fdSopenharmony_ci * @tc.name     Test BaseConnection
506d95e75fdSopenharmony_ci * @tc.desc     Function test ProcessNextChar
507d95e75fdSopenharmony_ci */
508d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, BaseConnectionTest_0009, Function | MediumTest | Level1)
509d95e75fdSopenharmony_ci{
510d95e75fdSopenharmony_ci    BaseConnection baseConnection;
511d95e75fdSopenharmony_ci    baseConnection.SetPostDialCallState(PostDialCallState::POST_DIAL_CALL_CANCELED);
512d95e75fdSopenharmony_ci    int32_t slotId = 0;
513d95e75fdSopenharmony_ci    char c = 'B';
514d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.ProcessNextChar(slotId, c), PostDialCallState::POST_DIAL_CALL_CANCELED);
515d95e75fdSopenharmony_ci
516d95e75fdSopenharmony_ci    baseConnection.SetPostDialCallState(PostDialCallState::POST_DIAL_CALL_NOT_STARTED);
517d95e75fdSopenharmony_ci    EXPECT_EQ(baseConnection.ProcessNextChar(slotId, c), PostDialCallState::POST_DIAL_CALL_COMPLETE);
518d95e75fdSopenharmony_ci
519d95e75fdSopenharmony_ci    baseConnection.SetPostDialCallState(PostDialCallState::POST_DIAL_CALL_NOT_STARTED);
520d95e75fdSopenharmony_ci    std::string phoneString = "13363669099,123321";
521d95e75fdSopenharmony_ci    baseConnection.UpdateCallNumber(phoneString);
522d95e75fdSopenharmony_ci    EXPECT_NE(baseConnection.ProcessNextChar(slotId, c), PostDialCallState::POST_DIAL_CALL_CANCELED);
523d95e75fdSopenharmony_ci}
524d95e75fdSopenharmony_ci
525d95e75fdSopenharmony_ci/**
526d95e75fdSopenharmony_ci * @tc.number   Telephony_SupplementRequestImsTest_0001
527d95e75fdSopenharmony_ci * @tc.name     Test SupplementRequestIms
528d95e75fdSopenharmony_ci * @tc.desc     Function test
529d95e75fdSopenharmony_ci */
530d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, SupplementRequestImsTest_0001, Function | MediumTest | Level1)
531d95e75fdSopenharmony_ci{
532d95e75fdSopenharmony_ci    SupplementRequestIms supplementRequestIms;
533d95e75fdSopenharmony_ci    int32_t slotId = 0;
534d95e75fdSopenharmony_ci    int32_t index = 0;
535d95e75fdSopenharmony_ci    int32_t ret = supplementRequestIms.GetClipRequest(slotId, index);
536d95e75fdSopenharmony_ci    EXPECT_NE(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
537d95e75fdSopenharmony_ci}
538d95e75fdSopenharmony_ci
539d95e75fdSopenharmony_ci/**
540d95e75fdSopenharmony_ci * @tc.number   Telephony_SupplementRequestImsTest_0002
541d95e75fdSopenharmony_ci * @tc.name     Test SupplementRequestIms
542d95e75fdSopenharmony_ci * @tc.desc     Function test
543d95e75fdSopenharmony_ci */
544d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, SupplementRequestImsTest_0002, Function | MediumTest | Level1)
545d95e75fdSopenharmony_ci{
546d95e75fdSopenharmony_ci    SupplementRequestIms supplementRequestIms;
547d95e75fdSopenharmony_ci    int32_t slotId = 0;
548d95e75fdSopenharmony_ci    int32_t reason = 0;
549d95e75fdSopenharmony_ci    int32_t index = 0;
550d95e75fdSopenharmony_ci    int32_t ret = supplementRequestIms.GetCallTransferRequest(slotId, reason, index);
551d95e75fdSopenharmony_ci    EXPECT_NE(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
552d95e75fdSopenharmony_ci}
553d95e75fdSopenharmony_ci
554d95e75fdSopenharmony_ci/**
555d95e75fdSopenharmony_ci * @tc.number   Telephony_SupplementRequestImsTest_0003
556d95e75fdSopenharmony_ci * @tc.name     Test SupplementRequestIms
557d95e75fdSopenharmony_ci * @tc.desc     Function test
558d95e75fdSopenharmony_ci */
559d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, SupplementRequestImsTest_0003, Function | MediumTest | Level1)
560d95e75fdSopenharmony_ci{
561d95e75fdSopenharmony_ci    SupplementRequestIms supplementRequestIms;
562d95e75fdSopenharmony_ci    int32_t slotId = 0;
563d95e75fdSopenharmony_ci    int32_t reason = 0;
564d95e75fdSopenharmony_ci    CallTransferInfo cfInfo;
565d95e75fdSopenharmony_ci    int32_t index = 0;
566d95e75fdSopenharmony_ci    int32_t ret = supplementRequestIms.SetCallTransferRequest(slotId, cfInfo, reason, index);
567d95e75fdSopenharmony_ci    EXPECT_NE(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
568d95e75fdSopenharmony_ci}
569d95e75fdSopenharmony_ci
570d95e75fdSopenharmony_ci/**
571d95e75fdSopenharmony_ci * @tc.number   Telephony_SupplementRequestImsTest_0004
572d95e75fdSopenharmony_ci * @tc.name     Test SupplementRequestIms
573d95e75fdSopenharmony_ci * @tc.desc     Function test
574d95e75fdSopenharmony_ci */
575d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, SupplementRequestImsTest_0004, Function | MediumTest | Level1)
576d95e75fdSopenharmony_ci{
577d95e75fdSopenharmony_ci    SupplementRequestIms supplementRequestIms;
578d95e75fdSopenharmony_ci    int32_t slotId = 0;
579d95e75fdSopenharmony_ci    bool result = false;
580d95e75fdSopenharmony_ci    int32_t ret = supplementRequestIms.CanSetCallTransferTime(slotId, result);
581d95e75fdSopenharmony_ci    EXPECT_NE(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
582d95e75fdSopenharmony_ci}
583d95e75fdSopenharmony_ci
584d95e75fdSopenharmony_ci/**
585d95e75fdSopenharmony_ci * @tc.number   Telephony_SupplementRequestImsTest_0005
586d95e75fdSopenharmony_ci * @tc.name     Test SupplementRequestIms
587d95e75fdSopenharmony_ci * @tc.desc     Function test
588d95e75fdSopenharmony_ci */
589d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, SupplementRequestImsTest_0005, Function | MediumTest | Level1)
590d95e75fdSopenharmony_ci{
591d95e75fdSopenharmony_ci    SupplementRequestIms supplementRequestIms;
592d95e75fdSopenharmony_ci    int32_t slotId = 0;
593d95e75fdSopenharmony_ci    int32_t reason = 0;
594d95e75fdSopenharmony_ci    int32_t index = 0;
595d95e75fdSopenharmony_ci    int32_t ret = supplementRequestIms.GetCallTransferRequest(slotId, reason, index);
596d95e75fdSopenharmony_ci    EXPECT_NE(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
597d95e75fdSopenharmony_ci}
598d95e75fdSopenharmony_ci
599d95e75fdSopenharmony_ci/**
600d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0001
601d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS HangUpRequest
602d95e75fdSopenharmony_ci * @tc.desc     Function test
603d95e75fdSopenharmony_ci */
604d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0001, Function | MediumTest | Level1)
605d95e75fdSopenharmony_ci{
606d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
607d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
608d95e75fdSopenharmony_ci    int32_t slotId = 0;
609d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.HangUpRequest(slotId);
610d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
611d95e75fdSopenharmony_ci
612d95e75fdSopenharmony_ci    slotId = -1;
613d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.HangUpRequest(slotId);
614d95e75fdSopenharmony_ci    EXPECT_EQ(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
615d95e75fdSopenharmony_ci}
616d95e75fdSopenharmony_ci
617d95e75fdSopenharmony_ci/**
618d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0002
619d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS AnswerRequest
620d95e75fdSopenharmony_ci * @tc.desc     Function test
621d95e75fdSopenharmony_ci */
622d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0002, Function | MediumTest | Level1)
623d95e75fdSopenharmony_ci{
624d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
625d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
626d95e75fdSopenharmony_ci    int32_t slotId = 0;
627d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.AnswerRequest(slotId);
628d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
629d95e75fdSopenharmony_ci
630d95e75fdSopenharmony_ci    slotId = -1;
631d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.AnswerRequest(slotId);
632d95e75fdSopenharmony_ci    EXPECT_EQ(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
633d95e75fdSopenharmony_ci}
634d95e75fdSopenharmony_ci
635d95e75fdSopenharmony_ci
636d95e75fdSopenharmony_ci/**
637d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0003
638d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS RejectRequest
639d95e75fdSopenharmony_ci * @tc.desc     Function test
640d95e75fdSopenharmony_ci */
641d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0003, Function | MediumTest | Level1)
642d95e75fdSopenharmony_ci{
643d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
644d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
645d95e75fdSopenharmony_ci    int32_t slotId = 0;
646d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.RejectRequest(slotId);
647d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
648d95e75fdSopenharmony_ci}
649d95e75fdSopenharmony_ci
650d95e75fdSopenharmony_ci/**
651d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0004
652d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS HoldRequest
653d95e75fdSopenharmony_ci * @tc.desc     Function test
654d95e75fdSopenharmony_ci */
655d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0004, Function | MediumTest | Level1)
656d95e75fdSopenharmony_ci{
657d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
658d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
659d95e75fdSopenharmony_ci    int32_t slotId = 0;
660d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.HoldRequest(slotId);
661d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
662d95e75fdSopenharmony_ci}
663d95e75fdSopenharmony_ci
664d95e75fdSopenharmony_ci/**
665d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0005
666d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS UnHoldRequest
667d95e75fdSopenharmony_ci * @tc.desc     Function test
668d95e75fdSopenharmony_ci */
669d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0005, Function | MediumTest | Level1)
670d95e75fdSopenharmony_ci{
671d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
672d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
673d95e75fdSopenharmony_ci    int32_t slotId = 0;
674d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.UnHoldCallRequest(slotId);
675d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
676d95e75fdSopenharmony_ci}
677d95e75fdSopenharmony_ci
678d95e75fdSopenharmony_ci/**
679d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0006
680d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS SwitchCallRequest
681d95e75fdSopenharmony_ci * @tc.desc     Function test
682d95e75fdSopenharmony_ci */
683d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0006, Function | MediumTest | Level1)
684d95e75fdSopenharmony_ci{
685d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
686d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
687d95e75fdSopenharmony_ci    int32_t slotId = 0;
688d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.SwitchCallRequest(slotId);
689d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
690d95e75fdSopenharmony_ci}
691d95e75fdSopenharmony_ci
692d95e75fdSopenharmony_ci/**
693d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0007
694d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS CombineConferenceRequest
695d95e75fdSopenharmony_ci * @tc.desc     Function test
696d95e75fdSopenharmony_ci */
697d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0007, Function | MediumTest | Level1)
698d95e75fdSopenharmony_ci{
699d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
700d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
701d95e75fdSopenharmony_ci    int32_t slotId = 0;
702d95e75fdSopenharmony_ci    int32_t voiceCall = 0;
703d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.CombineConferenceRequest(slotId, voiceCall);
704d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
705d95e75fdSopenharmony_ci
706d95e75fdSopenharmony_ci    slotId = -1;
707d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.CombineConferenceRequest(slotId, voiceCall);
708d95e75fdSopenharmony_ci    EXPECT_EQ(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
709d95e75fdSopenharmony_ci}
710d95e75fdSopenharmony_ci
711d95e75fdSopenharmony_ci/**
712d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0008
713d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS SeparateConferenceRequest
714d95e75fdSopenharmony_ci * @tc.desc     Function test
715d95e75fdSopenharmony_ci */
716d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0008, Function | MediumTest | Level1)
717d95e75fdSopenharmony_ci{
718d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
719d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
720d95e75fdSopenharmony_ci    int32_t slotId = 0;
721d95e75fdSopenharmony_ci    int32_t voiceCall = 0;
722d95e75fdSopenharmony_ci    int32_t index = 0;
723d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.SeparateConferenceRequest(slotId, index, voiceCall);
724d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
725d95e75fdSopenharmony_ci
726d95e75fdSopenharmony_ci    slotId = -1;
727d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.SeparateConferenceRequest(slotId, index, voiceCall);
728d95e75fdSopenharmony_ci    EXPECT_EQ(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
729d95e75fdSopenharmony_ci}
730d95e75fdSopenharmony_ci/**
731d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0009
732d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS CallSupplementRequest
733d95e75fdSopenharmony_ci * @tc.desc     Function test
734d95e75fdSopenharmony_ci */
735d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0009, Function | MediumTest | Level1)
736d95e75fdSopenharmony_ci{
737d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
738d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
739d95e75fdSopenharmony_ci    int32_t slotId = 0;
740d95e75fdSopenharmony_ci    CallSupplementType type = CallSupplementType::TYPE_DEFAULT;
741d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.CallSupplementRequest(slotId, type);
742d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
743d95e75fdSopenharmony_ci}
744d95e75fdSopenharmony_ci
745d95e75fdSopenharmony_ci/**
746d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0010
747d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS SendCDMAThreeWayDialRequest
748d95e75fdSopenharmony_ci * @tc.desc     Function test
749d95e75fdSopenharmony_ci */
750d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0010, Function | MediumTest | Level1)
751d95e75fdSopenharmony_ci{
752d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
753d95e75fdSopenharmony_ci    int32_t slotId = 0;
754d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.SendCDMAThreeWayDialRequest(slotId);
755d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_SUCCESS);
756d95e75fdSopenharmony_ci}
757d95e75fdSopenharmony_ci
758d95e75fdSopenharmony_ci/**
759d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0011
760d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS SeparateConferenceRequest
761d95e75fdSopenharmony_ci * @tc.desc     Function test
762d95e75fdSopenharmony_ci */
763d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0011, Function | MediumTest | Level1)
764d95e75fdSopenharmony_ci{
765d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
766d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
767d95e75fdSopenharmony_ci    int32_t slotId = 0;
768d95e75fdSopenharmony_ci    int32_t index = 0;
769d95e75fdSopenharmony_ci    char cDtmfCode = '0';
770d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.SendDtmfRequest(slotId, cDtmfCode, index);
771d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
772d95e75fdSopenharmony_ci}
773d95e75fdSopenharmony_ci
774d95e75fdSopenharmony_ci/**
775d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0012
776d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS StartDtmfRequest
777d95e75fdSopenharmony_ci * @tc.desc     Function test
778d95e75fdSopenharmony_ci */
779d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0012, Function | MediumTest | Level1)
780d95e75fdSopenharmony_ci{
781d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
782d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
783d95e75fdSopenharmony_ci    int32_t slotId = 0;
784d95e75fdSopenharmony_ci    int32_t index = 0;
785d95e75fdSopenharmony_ci    char cDtmfCode = '0';
786d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.StartDtmfRequest(slotId, cDtmfCode, index);
787d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
788d95e75fdSopenharmony_ci}
789d95e75fdSopenharmony_ci
790d95e75fdSopenharmony_ci/**
791d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0013
792d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS StopDtmfRequest
793d95e75fdSopenharmony_ci * @tc.desc     Function test
794d95e75fdSopenharmony_ci */
795d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0013, Function | MediumTest | Level1)
796d95e75fdSopenharmony_ci{
797d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
798d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
799d95e75fdSopenharmony_ci    int32_t slotId = 0;
800d95e75fdSopenharmony_ci    int32_t index = 0;
801d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.StopDtmfRequest(slotId, index);
802d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
803d95e75fdSopenharmony_ci}
804d95e75fdSopenharmony_ci
805d95e75fdSopenharmony_ci/**
806d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0014
807d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS GetCsCallsDataRequest
808d95e75fdSopenharmony_ci * @tc.desc     Function test
809d95e75fdSopenharmony_ci */
810d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0014, Function | MediumTest | Level1)
811d95e75fdSopenharmony_ci{
812d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
813d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
814d95e75fdSopenharmony_ci    int32_t slotId = 0;
815d95e75fdSopenharmony_ci    int64_t lastCallsDataFlag = 0;
816d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.GetCsCallsDataRequest(slotId, lastCallsDataFlag);
817d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
818d95e75fdSopenharmony_ci}
819d95e75fdSopenharmony_ci
820d95e75fdSopenharmony_ci/**
821d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0015
822d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS GetCallFailReasonRequest
823d95e75fdSopenharmony_ci * @tc.desc     Function test
824d95e75fdSopenharmony_ci */
825d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0015, Function | MediumTest | Level1)
826d95e75fdSopenharmony_ci{
827d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
828d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
829d95e75fdSopenharmony_ci    int32_t slotId = 0;
830d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.GetCallFailReasonRequest(slotId);
831d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
832d95e75fdSopenharmony_ci}
833d95e75fdSopenharmony_ci
834d95e75fdSopenharmony_ci/**
835d95e75fdSopenharmony_ci * @tc.number   Telephony_CellularCallConnectionCSTest_0016
836d95e75fdSopenharmony_ci * @tc.name     Test CellularCallConnectionCS ProcessPostDialCallChar
837d95e75fdSopenharmony_ci * @tc.desc     Function test
838d95e75fdSopenharmony_ci */
839d95e75fdSopenharmony_ciHWTEST_F(ImsConnectionTest, CellularCallConnectionCSTest_0016, Function | MediumTest | Level1)
840d95e75fdSopenharmony_ci{
841d95e75fdSopenharmony_ci    CellularCallConnectionCS cellularCallConnectionCS;
842d95e75fdSopenharmony_ci    DelayedSingleton<CellularCallService>::GetInstance()->Init();
843d95e75fdSopenharmony_ci    int32_t slotId = 0;
844d95e75fdSopenharmony_ci    char c = '0';
845d95e75fdSopenharmony_ci    int32_t ret = cellularCallConnectionCS.ProcessPostDialCallChar(slotId, c);
846d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_SUCCESS);
847d95e75fdSopenharmony_ci
848d95e75fdSopenharmony_ci    c = ',';
849d95e75fdSopenharmony_ci    slotId = -1;
850d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.ProcessPostDialCallChar(slotId, c);
851d95e75fdSopenharmony_ci    EXPECT_EQ(ret, CALL_ERR_RESOURCE_UNAVAILABLE);
852d95e75fdSopenharmony_ci
853d95e75fdSopenharmony_ci    slotId = 0;
854d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.ProcessPostDialCallChar(slotId, c);
855d95e75fdSopenharmony_ci    EXPECT_NE(ret, TELEPHONY_SUCCESS);
856d95e75fdSopenharmony_ci
857d95e75fdSopenharmony_ci    c = ';';
858d95e75fdSopenharmony_ci    ret = cellularCallConnectionCS.ProcessPostDialCallChar(slotId, c);
859d95e75fdSopenharmony_ci    EXPECT_EQ(ret, TELEPHONY_SUCCESS);
860d95e75fdSopenharmony_ci}
861d95e75fdSopenharmony_ci} // namespace Telephony
862d95e75fdSopenharmony_ci} // namespace OHOS
863