blob: 3849c4413d9c312f55d4a8d0d996f190db3d91fc [file] [log] [blame]
// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include <vector>
#include "shill/key_value_store.h"
#include "shill/service.h"
namespace shill {
class Error;
class Manager;
// This is a simple Service subclass with all the pure-virtual methods stubbed.
class ServiceUnderTest : public Service {
static const char kKeyValueStoreProperty[];
static const RpcIdentifier kRpcId;
static const char kStringsProperty[];
static const char kStorageId[];
explicit ServiceUnderTest(Manager* manager);
~ServiceUnderTest() override;
RpcIdentifier GetRpcIdentifier() const override;
RpcIdentifier GetDeviceRpcId(Error* error) const override;
std::string GetStorageIdentifier() const override;
// Getter and setter for a string array property for use in testing.
void set_strings(const std::vector<std::string>& strings) {
strings_ = strings;
const std::vector<std::string>& strings() const { return strings_; }
// Getter and setter for a KeyValueStore property for use in testing.
bool SetKeyValueStore(const KeyValueStore& value, Error* error);
KeyValueStore GetKeyValueStore(Error* error);
// Inherited from Service.
void OnConnect(Error* error) override {}
void OnDisconnect(Error* /*error*/, const char* /*reason*/) override {}
// The Service superclass has no string array or KeyValueStore properties
// but we need them in order to test Service::Configure.
std::vector<std::string> strings_;
KeyValueStore key_value_store_;
} // namespace shill