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 #ifndef OHOS_DISTRIBUTEDDATA_ACCOUNT_DELEGATE_MOCK_H 17 #define OHOS_DISTRIBUTEDDATA_ACCOUNT_DELEGATE_MOCK_H 18 19 #include <gmock/gmock.h> 20 #include <vector> 21 #include "account/account_delegate.h" 22 namespace OHOS { 23 namespace DistributedData { 24 class AccountDelegateMock : public AccountDelegate { 25 public: 26 virtual ~AccountDelegateMock() = default; 27 MOCK_METHOD(int32_t, Subscribe, (std::shared_ptr<AccountDelegate::Observer>)); 28 MOCK_METHOD(int32_t, Unsubscribe, (std::shared_ptr<AccountDelegate::Observer>)); 29 MOCK_METHOD(std::string, GetCurrentAccountId, (), (const)); 30 MOCK_METHOD(int32_t, GetUserByToken, (uint32_t), (const)); 31 MOCK_METHOD(void, SubscribeAccountEvent, ()); 32 MOCK_METHOD(void, UnsubscribeAccountEvent, ()); 33 MOCK_METHOD(bool, QueryUsers, (std::vector<int> &)); 34 MOCK_METHOD(bool, QueryForegroundUsers, (std::vector<int> &)); 35 MOCK_METHOD(bool, IsLoginAccount, ()); 36 MOCK_METHOD(bool, QueryForegroundUserId, (int &)); 37 MOCK_METHOD(bool, IsVerified, (int)); 38 MOCK_METHOD(bool, RegisterHashFunc, (HashFunc)); 39 MOCK_METHOD(bool, IsDeactivating, (int)); 40 MOCK_METHOD(void, BindExecutor, (std::shared_ptr<ExecutorPool>)); 41 MOCK_METHOD(std::string, GetUnencryptedAccountId, (int32_t), (const)); 42 MOCK_METHOD(bool, IsUserForeground, (int32_t)); 43 }; 44 } 45 } 46 #endif // OHOS_DISTRIBUTEDDATA_ACCOUNT_DELEGATE_MOCK_H