~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to tests/libtelephonyservice/MultimediaAccountEntryTest.cpp

  • Committer: Gustavo Pichorim Boiko
  • Date: 2016-10-03 21:36:53 UTC
  • mto: (1211.1.14 staging)
  • mto: This revision was merged to the branch mainline in revision 1213.
  • Revision ID: gustavo.boiko@canonical.com-20161003213653-x2685eh4f8c5j3gc
Remove the multimedia account type, it is not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2015 Canonical, Ltd.
3
 
 *
4
 
 * This file is part of telephony-service.
5
 
 *
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.
9
 
 *
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.
14
 
 *
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/>.
17
 
 */
18
 
 
19
 
#include <QtCore/QObject>
20
 
#include <QtTest/QtTest>
21
 
#include "telepathytest.h"
22
 
#include "multimediaaccountentry.h"
23
 
#include "accountentryfactory.h"
24
 
#include "mockcontroller.h"
25
 
 
26
 
class MultimediaAccountEntryTest : public TelepathyTest
27
 
{
28
 
    Q_OBJECT
29
 
 
30
 
private Q_SLOTS:
31
 
    void initTestCase();
32
 
    void init();
33
 
    void cleanup();
34
 
    void testAccountType();
35
 
 
36
 
private:
37
 
    MultimediaAccountEntry *mAccount;
38
 
    Tp::AccountPtr mMultimediaAccount;
39
 
    MockController *mMockController;
40
 
};
41
 
 
42
 
void MultimediaAccountEntryTest::initTestCase()
43
 
{
44
 
    initialize();
45
 
}
46
 
 
47
 
void MultimediaAccountEntryTest::init()
48
 
{
49
 
    mMultimediaAccount = addAccount("mock", "multimedia", "multimedia account");
50
 
    QVERIFY(!mMultimediaAccount.isNull());
51
 
    mAccount = qobject_cast<MultimediaAccountEntry*>(AccountEntryFactory::createEntry(mMultimediaAccount, this));
52
 
    QVERIFY(mAccount);
53
 
    TRY_VERIFY(mAccount->ready());
54
 
 
55
 
    // make sure the connection is available
56
 
    TRY_VERIFY(mAccount->connected());
57
 
 
58
 
    // and make sure the status and status message are the ones we expect
59
 
    TRY_COMPARE(mAccount->status(), QString("available"));
60
 
 
61
 
    // create the mock controller
62
 
    mMockController = new MockController("multimedia", this);
63
 
}
64
 
 
65
 
void MultimediaAccountEntryTest::cleanup()
66
 
{
67
 
    doCleanup();
68
 
    mAccount->deleteLater();
69
 
    mMockController->deleteLater();
70
 
}
71
 
 
72
 
void MultimediaAccountEntryTest::testAccountType()
73
 
{
74
 
    QCOMPARE(mAccount->type(), AccountEntry::MultimediaAccount);
75
 
}
76
 
 
77
 
QTEST_MAIN(MultimediaAccountEntryTest)
78
 
#include "MultimediaAccountEntryTest.moc"