1 /* 2 * Copyright (c) 2021-2022 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 CONTACTGROUP_TEST_H 17 #define CONTACTGROUP_TEST_H 18 19 #include "base_test.h" 20 21 namespace Contacts { 22 namespace Test { 23 class ContactGroupTest : public BaseTest { 24 public: 25 ContactGroupTest(); 26 ~ContactGroupTest(); 27 int64_t GroupsInsert(std::string groupName, OHOS::DataShare::DataShareValuesBucket &groupValues); 28 int ContactUpdate(const std::string &tableName, OHOS::DataShare::DataShareValuesBucket updateValues, 29 OHOS::DataShare::DataSharePredicates predicates); 30 int ContactDelete(const std::string &tableName, OHOS::DataShare::DataSharePredicates predicates); 31 std::shared_ptr<OHOS::DataShare::DataShareResultSet> ContactQuery(const std::string &tableName, 32 std::vector<std::string> columns, OHOS::DataShare::DataSharePredicates predicates); 33 void QueryAndExpectResult(const std::string &tableName, OHOS::DataShare::DataSharePredicates predicates, 34 OHOS::DataShare::DataShareValuesBucket &values, std::string testName); 35 OHOS::DataShare::DataShareValuesBucket GetAllColumnsValues( 36 std::vector<std::string> &columnsInt, std::vector<std::string> &columnsStr); 37 int64_t GroupsInsertValues(OHOS::DataShare::DataShareValuesBucket &values); 38 void GetAllGroupsColumns(std::vector<std::string> &columnInt, std::vector<std::string> &columnStr); 39 void MergeColumns( 40 std::vector<std::string> &columns, std::vector<std::string> &columnsInt, std::vector<std::string> &columnsStr); 41 void ClearData(); 42 }; 43 } // namespace Test 44 } // namespace Contacts 45 #endif // CONTACTGROUP_TEST_H 46