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 GTEST_LOG_(INFO) << "MOCK MatchingSkills MatchingSkills"; 28 entities_ = matchingSkills.entities_; 29 events_ = matchingSkills.events_; 30 schemes_ = matchingSkills.schemes_; 31 } 32 ~MatchingSkills()33MatchingSkills::~MatchingSkills() 34 {} 35 GetEntity(size_t index) const36std::string MatchingSkills::GetEntity(size_t index) const 37 { 38 (void)index; 39 std::string entity(""); 40 return entity; 41 } 42 AddEntity(const std::string & entity)43void MatchingSkills::AddEntity(const std::string& entity) 44 { 45 (void)entity; 46 } 47 HasEntity(const std::string & entity) const48bool MatchingSkills::HasEntity(const std::string& entity) const 49 { 50 (void)entity; 51 return true; 52 } 53 RemoveEntity(const std::string & entity)54void MatchingSkills::RemoveEntity(const std::string& entity) 55 { 56 (void)entity; 57 } 58 CountEntities() const59size_t MatchingSkills::CountEntities() const 60 { 61 return entities_.size(); 62 } 63 AddEvent(const std::string & event)64void MatchingSkills::AddEvent(const std::string& event) 65 { 66 GTEST_LOG_(INFO) << "MOCK MatchingSkills AddEvent"; 67 } 68 CountEvent() const69size_t MatchingSkills::CountEvent() const 70 { 71 return events_.size(); 72 } 73 GetEvent(size_t index) const74std::string MatchingSkills::GetEvent(size_t index) const 75 { 76 std::string event; 77 return event; 78 } 79 GetEvents() const80std::vector<std::string> MatchingSkills::GetEvents() const 81 { 82 return events_; 83 } 84 RemoveEvent(const std::string & event)85void MatchingSkills::RemoveEvent(const std::string& event) 86 { 87 (void)event; 88 } 89 HasEvent(const std::string & event) const90bool MatchingSkills::HasEvent(const std::string& event) const 91 { 92 (void)event; 93 return true; 94 } 95 GetScheme(size_t index) const96std::string MatchingSkills::GetScheme(size_t index) const 97 { 98 (void)index; 99 std::string schemes(""); 100 return schemes; 101 } 102 AddScheme(const std::string & scheme)103void MatchingSkills::AddScheme(const std::string& scheme) 104 {} 105 HasScheme(const std::string & scheme) const106bool MatchingSkills::HasScheme(const std::string& scheme) const 107 { 108 return true; 109 } 110 RemoveScheme(const std::string & scheme)111void MatchingSkills::RemoveScheme(const std::string& scheme) 112 {} 113 CountSchemes() const114size_t MatchingSkills::CountSchemes() const 115 { 116 return 0; 117 } 118 Marshalling(Parcel & parcel) const119bool MatchingSkills::Marshalling(Parcel& parcel) const 120 { 121 return true; 122 } 123 ReadFromParcel(Parcel & parcel)124bool MatchingSkills::ReadFromParcel(Parcel& parcel) 125 { 126 return true; 127 } 128 Unmarshalling(Parcel & parcel)129MatchingSkills* MatchingSkills::Unmarshalling(Parcel& parcel) 130 { 131 return nullptr; 132 } 133 MatchEvent(const std::string & event) const134bool MatchingSkills::MatchEvent(const std::string& event) const 135 { 136 return true; 137 } 138 MatchEntity(const std::vector<std::string> & entities) const139bool MatchingSkills::MatchEntity(const std::vector<std::string>& entities) const 140 { 141 return true; 142 } 143 MatchScheme(const std::string & scheme) const144bool MatchingSkills::MatchScheme(const std::string& scheme) const 145 { 146 return true; 147 } 148 Match(const Want & want) const149bool MatchingSkills::Match(const Want& want) const 150 { 151 return true; 152 } 153 } // namespace EventFwk 154 } // namespace OHOS 155