45
|
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 |
#include <QGraphicsItem>
|
|
18 |
#include <hbmodeliterator.h>
|
|
19 |
#include <QtTest/QtTest>
|
|
20 |
|
|
21 |
#include "calenservices.h"
|
|
22 |
#include "calendayitemview.h"
|
|
23 |
|
|
24 |
// Test variables
|
|
25 |
QRectF gTestWindowRect = QRectF(0, 0, 10, 20);
|
|
26 |
Qt::Orientation gTestOrientation = Qt::Horizontal;
|
|
27 |
|
|
28 |
class TestCalenItemView : public QObject
|
|
29 |
{
|
|
30 |
Q_OBJECT
|
|
31 |
|
|
32 |
public:
|
|
33 |
TestCalenItemView();
|
|
34 |
virtual ~TestCalenItemView();
|
|
35 |
|
|
36 |
private slots:
|
|
37 |
void initTestCase();
|
|
38 |
void cleanupTestCase();
|
|
39 |
void init();
|
|
40 |
void cleanup();
|
|
41 |
|
|
42 |
void testConstructors();
|
|
43 |
private:
|
|
44 |
MCalenServices mMCalenServices;
|
|
45 |
|
|
46 |
};
|
|
47 |
|
|
48 |
/*!
|
|
49 |
Constructor
|
|
50 |
*/
|
|
51 |
TestCalenItemView::TestCalenItemView()
|
|
52 |
{
|
|
53 |
|
|
54 |
}
|
|
55 |
|
|
56 |
/*!
|
|
57 |
Destructor
|
|
58 |
*/
|
|
59 |
TestCalenItemView::~TestCalenItemView()
|
|
60 |
{
|
|
61 |
|
|
62 |
}
|
|
63 |
|
|
64 |
/*!
|
|
65 |
Called before testcase
|
|
66 |
*/
|
|
67 |
void TestCalenItemView::initTestCase()
|
|
68 |
{
|
|
69 |
}
|
|
70 |
|
|
71 |
/*!
|
|
72 |
Called after testcase
|
|
73 |
*/
|
|
74 |
void TestCalenItemView::cleanupTestCase()
|
|
75 |
{
|
|
76 |
|
|
77 |
}
|
|
78 |
|
|
79 |
/*!
|
|
80 |
Called before every function
|
|
81 |
*/
|
|
82 |
void TestCalenItemView::init()
|
|
83 |
{
|
|
84 |
|
|
85 |
}
|
|
86 |
|
|
87 |
/*!
|
|
88 |
Called after everyfunction
|
|
89 |
*/
|
|
90 |
void TestCalenItemView::cleanup()
|
|
91 |
{
|
|
92 |
|
|
93 |
}
|
|
94 |
|
|
95 |
/*!
|
|
96 |
Test function for constructors
|
|
97 |
1. Test if content widget is not initialized
|
|
98 |
2. Test if content widget is correcty created
|
|
99 |
*/
|
|
100 |
void TestCalenItemView::testConstructors()
|
|
101 |
{
|
|
102 |
//1)
|
|
103 |
CalenDayItemView *testItemView = 0;
|
|
104 |
QVERIFY(!testItemView);
|
|
105 |
|
|
106 |
//2)
|
|
107 |
HbModelIterator *iterator = new HbModelIterator();
|
|
108 |
testItemView = new CalenDayItemView(mMCalenServices,iterator,0);
|
|
109 |
QVERIFY(testItemView);
|
|
110 |
delete testItemView;
|
|
111 |
}
|
|
112 |
|
|
113 |
QTEST_MAIN(TestCalenItemView);
|
|
114 |
#include "unittest_calendayitemview.moc"
|