2
* This file is part of system-settings
4
* Copyright (C) 2013 Canonical Ltd.
6
* Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8
* This program is free software: you can redistribute it and/or modify it
9
* under the terms of the GNU General Public License version 3, as published
10
* by the Free Software Foundation.
12
* This program is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranties of
14
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
* PURPOSE. See the GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License along
18
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "plugin-manager.h"
29
using namespace SystemSettings;
31
class PluginsTest: public QObject
42
void PluginsTest::testCategory()
44
PluginManager manager;
46
QSet<QString> expectedCategories;
47
expectedCategories << "phone" << "network";
48
QCOMPARE(manager.categories().toSet(), expectedCategories);
50
QList<Plugin *> plugins = manager.plugins("phone");
51
QCOMPARE(plugins.count(), 1);
52
QCOMPARE(plugins[0]->displayName(), QString("Cellular"));
54
plugins = manager.plugins("network");
55
QCOMPARE(plugins.count(), 2);
57
Q_FOREACH(Plugin *plugin, plugins) {
58
names << plugin->displayName();
60
QSet<QString> expectedNames;
61
expectedNames << "Bluetooth" << "Wireless";
62
QCOMPARE(names.toSet(), expectedNames);
65
QTEST_MAIN(PluginsTest);
66
#include "tst_plugins.moc"