33
|
1 |
/*!
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <QtGui>
|
|
19 |
#include <QtTest/QtTest>
|
|
20 |
|
|
21 |
#include <hbapplication.h>
|
|
22 |
|
|
23 |
#include "dialpadtest.h"
|
|
24 |
#include "dialpadnumericbutton.h"
|
|
25 |
|
|
26 |
class ut_DialpadNumericButton : public QObject
|
|
27 |
{
|
|
28 |
Q_OBJECT
|
|
29 |
|
|
30 |
private slots:
|
|
31 |
void initTestCase();
|
|
32 |
void cleanupTestCase();
|
|
33 |
|
48
|
34 |
void testSetPrimaryLabel();
|
|
35 |
void testSetSecondaryLabel();
|
|
36 |
void testSetSecondaryLableRow2();
|
33
|
37 |
void testSetIcon();
|
|
38 |
|
|
39 |
private:
|
|
40 |
DialpadNumericButton *mButton;
|
|
41 |
};
|
|
42 |
|
|
43 |
void ut_DialpadNumericButton::initTestCase()
|
|
44 |
{
|
|
45 |
mButton = new DialpadNumericButton(0,QPoint(1,1),QSize(1,1));
|
|
46 |
}
|
|
47 |
|
|
48 |
void ut_DialpadNumericButton::cleanupTestCase()
|
|
49 |
{
|
|
50 |
delete mButton;
|
|
51 |
}
|
|
52 |
|
48
|
53 |
void ut_DialpadNumericButton::testSetPrimaryLabel()
|
33
|
54 |
{
|
48
|
55 |
QVERIFY(mButton->primaryLabel().isNull());
|
|
56 |
mButton->setPrimaryLabel(QLatin1String("Primary text"));
|
|
57 |
QVERIFY(mButton->primaryLabel() == QLatin1String("Primary text"));
|
33
|
58 |
}
|
|
59 |
|
48
|
60 |
void ut_DialpadNumericButton::testSetSecondaryLabel()
|
33
|
61 |
{
|
48
|
62 |
QVERIFY(mButton->secondaryLabel().isNull());
|
|
63 |
mButton->setSecondaryLabel(QLatin1String("Secondary text"));
|
|
64 |
QVERIFY(mButton->secondaryLabel() == QLatin1String("Secondary text"));
|
33
|
65 |
}
|
|
66 |
|
48
|
67 |
void ut_DialpadNumericButton::testSetSecondaryLableRow2()
|
|
68 |
{
|
|
69 |
QVERIFY(mButton->secondaryLabelRow2().isNull());
|
|
70 |
mButton->setSecondaryLabelRow2(QLatin1String("Secondary 2nd row text"));
|
|
71 |
QVERIFY(mButton->secondaryLabelRow2() == QLatin1String("Secondary 2nd row text"));
|
|
72 |
}
|
|
73 |
|
|
74 |
|
33
|
75 |
void ut_DialpadNumericButton::testSetIcon()
|
|
76 |
{
|
|
77 |
HbIcon icon(QLatin1String("dummy.svg"));
|
|
78 |
|
|
79 |
QVERIFY(mButton->icon().isNull());
|
|
80 |
mButton->setIcon(icon);
|
|
81 |
mButton->icon().setColor(Qt::white);
|
|
82 |
QVERIFY(mButton->icon().iconName() == QLatin1String("dummy.svg"));
|
|
83 |
QVERIFY(mButton->icon().color() == Qt::white);
|
|
84 |
}
|
|
85 |
|
|
86 |
DIALPAD_TEST_MAIN(ut_DialpadNumericButton)
|
|
87 |
#include "ut_dialpadnumericbutton.moc"
|