2
* Copyright (C) 2015 Canonical, Ltd.
4
* This file is part of telephony-service.
6
* telephony-service is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* telephony-service is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#include <QtCore/QObject>
20
#include <QtTest/QtTest>
21
#include "telepathytest.h"
22
#include "multimediaaccountentry.h"
23
#include "accountentryfactory.h"
24
#include "mockcontroller.h"
26
class MultimediaAccountEntryTest : public TelepathyTest
34
void testAccountType();
37
MultimediaAccountEntry *mAccount;
38
Tp::AccountPtr mMultimediaAccount;
39
MockController *mMockController;
42
void MultimediaAccountEntryTest::initTestCase()
47
void MultimediaAccountEntryTest::init()
49
mMultimediaAccount = addAccount("mock", "multimedia", "multimedia account");
50
QVERIFY(!mMultimediaAccount.isNull());
51
mAccount = qobject_cast<MultimediaAccountEntry*>(AccountEntryFactory::createEntry(mMultimediaAccount, this));
53
TRY_VERIFY(mAccount->ready());
55
// make sure the connection is available
56
TRY_VERIFY(mAccount->connected());
58
// and make sure the status and status message are the ones we expect
59
TRY_COMPARE(mAccount->status(), QString("available"));
61
// create the mock controller
62
mMockController = new MockController("multimedia", this);
65
void MultimediaAccountEntryTest::cleanup()
68
mAccount->deleteLater();
69
mMockController->deleteLater();
72
void MultimediaAccountEntryTest::testAccountType()
74
QCOMPARE(mAccount->type(), AccountEntry::MultimediaAccount);
77
QTEST_MAIN(MultimediaAccountEntryTest)
78
#include "MultimediaAccountEntryTest.moc"