blob: c043bd75c9e6e74fe1e7544e9c8225e85af59833 [file] [log] [blame]
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -07001// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Ben Chanc54afe52014-11-05 10:28:08 -08005#ifndef SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_
6#define SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -07007
8#include <string>
Prathmesh Prabhu92df6192014-04-29 18:08:08 -07009#include <vector>
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070010
11#include <gmock/gmock.h>
12
Ben Chanc54afe52014-11-05 10:28:08 -080013#include "shill/cellular/mobile_operator_info.h"
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070014
15using testing::ReturnRef;
16
17namespace shill {
18
19class MockMobileOperatorInfo : public MobileOperatorInfo {
20 public:
Paul Stewart2f6c7892015-06-16 13:13:10 -070021 MockMobileOperatorInfo(EventDispatcher* dispatcher,
22 const std::string& info_owner);
Ben Chan5ea763b2014-08-13 11:07:54 -070023 ~MockMobileOperatorInfo() override;
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070024
25 MOCK_CONST_METHOD0(IsMobileNetworkOperatorKnown, bool());
26
Paul Stewart2f6c7892015-06-16 13:13:10 -070027 MOCK_CONST_METHOD0(mccmnc, const std::string&());
Prathmesh Prabhu92df6192014-04-29 18:08:08 -070028 MOCK_CONST_METHOD0(olp_list,
Paul Stewart2f6c7892015-06-16 13:13:10 -070029 const std::vector<MobileOperatorInfo::OnlinePortal>&());
30 MOCK_CONST_METHOD0(activation_code, const std::string&());
31 MOCK_CONST_METHOD0(operator_name, const std::string&());
32 MOCK_CONST_METHOD0(country, const std::string&());
33 MOCK_CONST_METHOD0(uuid, const std::string&());
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070034
Paul Stewart2f6c7892015-06-16 13:13:10 -070035 MOCK_METHOD1(UpdateMCCMNC, void(const std::string&));
36 MOCK_METHOD1(UpdateSID, void(const std::string&));
37 MOCK_METHOD1(UpdateIMSI, void(const std::string&));
38 MOCK_METHOD1(UpdateNID, void(const std::string&));
39 MOCK_METHOD1(UpdateOperatorName, void(const std::string&));
Prathmesh Prabhu6e0a8ef2014-05-05 22:30:07 -070040
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070041 // Sets up the mock object to return empty strings/vectors etc for all
42 // propeties.
43 void SetEmptyDefaultsForProperties();
44
45 private:
46 std::string empty_mccmnc_;
Prathmesh Prabhu92df6192014-04-29 18:08:08 -070047 std::vector<MobileOperatorInfo::OnlinePortal> empty_olp_list_;
Prathmesh Prabhuf2288212014-05-21 19:19:19 -070048 std::string empty_activation_code_;
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070049 std::string empty_operator_name_;
Prathmesh Prabhu6e0a8ef2014-05-05 22:30:07 -070050 std::string empty_country_;
Prathmesh Prabhu401a5b92014-04-29 17:37:55 -070051 std::string empty_uuid_;
Prathmesh Prabhu95afcbb2014-04-08 16:05:42 -070052};
53
54} // namespace shill
55
Ben Chanc54afe52014-11-05 10:28:08 -080056#endif // SHILL_CELLULAR_MOCK_MOBILE_OPERATOR_INFO_H_