2
* Copyright 2013 Canonical Ltd.
5
* Charles Kerr <charles.kerr@canonical.com>
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef MOCK_ACCOUNTS_H
21
#define MOCK_ACCOUNTS_H
26
#include "mock-object.h"
27
#include "backend-dbus/dbus-accounts.h" // struct Accounts
31
class MockAccounts: public MockObject
35
MockAccounts (GMainLoop * loop,
36
GDBusConnection * bus_connection);
37
virtual ~MockAccounts ();
39
void add_user (MockUser * user);
40
void remove_user (MockUser * user);
41
size_t size() const { return my_users.size(); }
42
MockUser * find_by_uid (guint64 uid);
43
MockUser * find_by_username (const char * username);
47
Accounts * my_skeleton;
49
typedef std::set<MockUser*> users_t;
52
typedef std::map<guint,MockUser*> uid_to_user_t;
53
uid_to_user_t my_uid_to_user;
55
typedef std::map<std::string,MockUser*> path_to_user_t;
56
path_to_user_t my_path_to_user;
58
typedef std::map<std::string,MockUser*> username_to_user_t;
59
username_to_user_t my_username_to_user;
63
static gboolean on_find_user_by_id_static (Accounts *,
64
GDBusMethodInvocation *,
68
static gboolean on_list_cached_users_static (Accounts *,
69
GDBusMethodInvocation *,
73
#endif // #ifndef MOCK_ACCOUNTS_H