1 /* 2 * Copyright (C) 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 #include <gtest/gtest.h> 17 #include "matching_skills.h" 18 #include "string_ex.h" 19 20 namespace OHOS { 21 namespace EventFwk { MatchingSkills()22MatchingSkills::MatchingSkills() 23 {} 24 MatchingSkills(const MatchingSkills & matchingSkills)25MatchingSkills::MatchingSkills(const MatchingSkills& matchingSkills) 26 { 27 entities_ = matchingSkills.entities_; 28 events_ = matchingSkills.events_; 29 schemes_ = matchingSkills.schemes_; 30 } 31 ~MatchingSkills()32MatchingSkills::~MatchingSkills() 33 {} 34 GetEntity(size_t index) const35std::string MatchingSkills::GetEntity(size_t index) const 36 { 37 std::string entity; 38 return entity; 39 } 40 AddEntity(const std::string & entity)41void MatchingSkills::AddEntity(const std::string& entity) 42 {} 43 HasEntity(const std::string & entity) const44bool MatchingSkills::HasEntity(const std::string& entity) const 45 { 46 return true; 47 } 48 RemoveEntity(const std::string & entity)49void MatchingSkills::RemoveEntity(const std::string& entity) 50 {} 51 CountEntities() const52size_t MatchingSkills::CountEntities() const 53 { 54 return entities_.size(); 55 } 56 AddEvent(const std::string & event)57void MatchingSkills::AddEvent(const std::string& event) 58 { 59 GTEST_LOG_(INFO) << "MOCK MatchingSkills AddEvent"; 60 } 61 CountEvent() const62size_t MatchingSkills::CountEvent() const 63 { 64 return events_.size(); 65 } 66 GetEvent(size_t index) const67std::string MatchingSkills::GetEvent(size_t index) const 68 { 69 std::string event; 70 return event; 71 } 72 GetEvents() const73std::vector<std::string> MatchingSkills::GetEvents() const 74 { 75 return events_; 76 } 77 RemoveEvent(const std::string & event)78void MatchingSkills::RemoveEvent(const std::string& event) 79 {} 80 HasEvent(const std::string & event) const81bool MatchingSkills::HasEvent(const std::string& event) const 82 { 83 return true; 84 } 85 GetScheme(size_t index) const86std::string MatchingSkills::GetScheme(size_t index) const 87 { 88 std::string schemes; 89 return schemes; 90 } 91 AddScheme(const std::string & scheme)92void MatchingSkills::AddScheme(const std::string& scheme) 93 {} 94 HasScheme(const std::string & scheme) const95bool MatchingSkills::HasScheme(const std::string& scheme) const 96 { 97 return true; 98 } 99 RemoveScheme(const std::string & scheme)100void MatchingSkills::RemoveScheme(const std::string& scheme) 101 {} 102 CountSchemes() const103size_t MatchingSkills::CountSchemes() const 104 { 105 return 0; 106 } 107 Marshalling(Parcel & parcel) const108bool MatchingSkills::Marshalling(Parcel& parcel) const 109 { 110 return true; 111 } 112 ReadFromParcel(Parcel & parcel)113bool MatchingSkills::ReadFromParcel(Parcel& parcel) 114 { 115 return true; 116 } 117 Unmarshalling(Parcel & parcel)118MatchingSkills* MatchingSkills::Unmarshalling(Parcel& parcel) 119 { 120 return nullptr; 121 } 122 MatchEvent(const std::string & event) const123bool MatchingSkills::MatchEvent(const std::string& event) const 124 { 125 return true; 126 } 127 MatchEntity(const std::vector<std::string> & entities) const128bool MatchingSkills::MatchEntity(const std::vector<std::string>& entities) const 129 { 130 return true; 131 } 132 MatchScheme(const std::string & scheme) const133bool MatchingSkills::MatchScheme(const std::string& scheme) const 134 { 135 return true; 136 } 137 Match(const Want & want) const138bool MatchingSkills::Match(const Want& want) const 139 { 140 return true; 141 } 142 } // namespace EventFwk 143 } // namespace OHOS 144