1 // 2 // Copyright (C) 2014 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 17 #ifndef SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_ 18 #define SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_ 19 20 #include <string> 21 #include <vector> 22 23 #include <gmock/gmock.h> 24 25 #include "shill/cellular/mobile_operator_info.h" 26 27 using testing::ReturnRef; 28 29 namespace shill { 30 31 class MockMobileOperatorInfo : public MobileOperatorInfo { 32 public: 33 MockMobileOperatorInfo(EventDispatcher* dispatcher, 34 const std::string& info_owner); 35 ~MockMobileOperatorInfo() override; 36 37 MOCK_CONST_METHOD0(IsMobileNetworkOperatorKnown, bool()); 38 39 MOCK_CONST_METHOD0(mccmnc, const std::string&()); 40 MOCK_CONST_METHOD0(olp_list, 41 const std::vector<MobileOperatorInfo::OnlinePortal>&()); 42 MOCK_CONST_METHOD0(activation_code, const std::string&()); 43 MOCK_CONST_METHOD0(operator_name, const std::string&()); 44 MOCK_CONST_METHOD0(country, const std::string&()); 45 MOCK_CONST_METHOD0(uuid, const std::string&()); 46 47 MOCK_METHOD1(UpdateMCCMNC, void(const std::string&)); 48 MOCK_METHOD1(UpdateSID, void(const std::string&)); 49 MOCK_METHOD1(UpdateIMSI, void(const std::string&)); 50 MOCK_METHOD1(UpdateNID, void(const std::string&)); 51 MOCK_METHOD1(UpdateOperatorName, void(const std::string&)); 52 53 // Sets up the mock object to return empty strings/vectors etc for all 54 // propeties. 55 void SetEmptyDefaultsForProperties(); 56 57 private: 58 std::string empty_mccmnc_; 59 std::vector<MobileOperatorInfo::OnlinePortal> empty_olp_list_; 60 std::string empty_activation_code_; 61 std::string empty_operator_name_; 62 std::string empty_country_; 63 std::string empty_uuid_; 64 }; 65 66 } // namespace shill 67 68 #endif // SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_ 69