1 //
2 // Copyright (C) 2012 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_MOCK_PROFILE_H_
18 #define SHILL_MOCK_PROFILE_H_
19 
20 #include <string>
21 
22 #include <gmock/gmock.h>
23 
24 #include "shill/profile.h"
25 #include "shill/wifi/wifi_provider.h"
26 
27 namespace shill {
28 
29 class MockProfile : public Profile {
30  public:
31   MockProfile(ControlInterface* control, Metrics* metrics, Manager* manager);
32   MockProfile(ControlInterface* control,
33               Metrics* metrics,
34               Manager* manager,
35               const std::string& identifier);
36   ~MockProfile() override;
37 
38   MOCK_METHOD1(AdoptService, bool(const ServiceRefPtr& service));
39   MOCK_METHOD1(AbandonService, bool(const ServiceRefPtr& service));
40   MOCK_METHOD1(LoadService,  bool(const ServiceRefPtr& service));
41   MOCK_METHOD1(ConfigureService,  bool(const ServiceRefPtr& service));
42   MOCK_METHOD1(ConfigureDevice, bool(const DeviceRefPtr& device));
43   MOCK_METHOD2(DeleteEntry,  void(const std::string& entry_name, Error* error));
44   MOCK_METHOD0(GetRpcIdentifier, std::string());
45   MOCK_METHOD1(UpdateService, bool(const ServiceRefPtr& service));
46   MOCK_METHOD1(UpdateDevice, bool(const DeviceRefPtr& device));
47   MOCK_METHOD1(UpdateWiFiProvider, bool(const WiFiProvider& wifi_provider));
48   MOCK_METHOD0(Save, bool());
49   MOCK_METHOD0(GetStorage, StoreInterface*());
50   MOCK_CONST_METHOD0(GetConstStorage, const StoreInterface*());
51   MOCK_CONST_METHOD0(IsDefault, bool());
52 
53  private:
54   DISALLOW_COPY_AND_ASSIGN(MockProfile);
55 };
56 
57 }  // namespace shill
58 
59 #endif  // SHILL_MOCK_PROFILE_H_
60