1 /*
2  * Copyright (C) 2024-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 #ifndef __MOCK_IMS_SMS_INTERFACE_H__
16 #define __MOCK_IMS_SMS_INTERFACE_H__
17 #include "ims_sms_client.h"
18 #include "ims_sms_proxy.h"
19 #include "ims_sms_callback_stub.h"
20 
21 namespace OHOS {
22 namespace Telephony {
23 
24 class MockImsSms : public ImsSmsInterface {
25 public:
26     int32_t ImsSendMessage(int32_t slotId, const ImsMessageInfo &imsMessageInfo) override
27     {
28         return retImsSendMessage;
29     }
30     int32_t ImsSetSmsConfig(int32_t slotId, int32_t imsSmsConfig) override
31     {
32         return retImsSetSmsConfig;
33     }
34     int32_t ImsGetSmsConfig(int32_t slotId) override
35     {
36         return retImsGetSmsConfig;
37     }
38     int32_t RegisterImsSmsCallback(const sptr<ImsSmsCallbackInterface> &callback) override
39     {
40         return retRegisterImsSmsCallback;
41     }
42     sptr<IRemoteObject> AsObject() override
43     {
44         return retRemoteObject;
45     }
46 public:
47     int32_t retImsSendMessage;
48     int32_t retImsSetSmsConfig;
49     int32_t retImsGetSmsConfig;
50     int32_t retRegisterImsSmsCallback;
51     IRemoteObject* retRemoteObject;
52 };
53 
54 class MockImsSmsProxy : public ImsSmsProxy {
55 public:
MockImsSmsProxy(const sptr<IRemoteObject> &impl)56     explicit MockImsSmsProxy(const sptr<IRemoteObject> &impl) : ImsSmsProxy(impl) {}
57     sptr<IRemoteObject> AsObject() override
58     {
59         return retRemoteObject;
60     }
61 public:
62     IRemoteObject* retRemoteObject;
63 };
64 }
65 }
66 #endif