File: servertest.cpp

package info (click to toggle)
libindicate-qt 0.2.5.91-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 388 kB
  • ctags: 262
  • sloc: cpp: 1,655; makefile: 6
file content (44 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Qt wrapper for libindicate
 *
 * Copyright 2009 Canonical Ltd.
 *
 * Authors:
 * - Aurélien Gâteau <aurelien.gateau@canonical.com>
 *
 * License: LGPL v2.1 or LGPL v3
 */
// Self
#include "servertest.h"

// Qt
#include <QtTest>

// Local
#include <qindicateserver.h>

QTEST_MAIN(ServerTest)

void ServerTest::testShowHide()
{
    const QString type = "message";

    QIndicate::Server server;
    QSignalSpy showSpy(&server, SIGNAL(serverShow(const QString&)));
    QSignalSpy hideSpy(&server, SIGNAL(serverHide(const QString&)));

    server.setType(type);
    server.show();

    QCOMPARE(showSpy.count(), 1);
    QVariantList args = showSpy.takeFirst();
    QCOMPARE(args[0].toString(), type);

    server.hide();

    QCOMPARE(hideSpy.count(), 1);
    args = hideSpy.takeFirst();
    QCOMPARE(args[0].toString(), type);
}

#include "servertest.moc"