calendarui/views/dayview/tsrc/unittests/unittest_calendaystatusstrip/unittest_calendaystatusstrip.cpp
equal
deleted
inserted
replaced
40 void cleanupTestCase(); |
40 void cleanupTestCase(); |
41 void init(); |
41 void init(); |
42 void cleanup(); |
42 void cleanup(); |
43 |
43 |
44 void testConstructors(); |
44 void testConstructors(); |
45 void testSetGetColor(); |
|
46 void testSetGetRange(); |
45 void testSetGetRange(); |
47 void testSetGetDrawingStyle_data(); |
46 void testSetGetDrawingStyle_data(); |
48 void testSetGetDrawingStyle(); |
47 void testSetGetDrawingStyle(); |
49 void testStartEndTime(); |
48 void testStartEndTime(); |
50 void testCreatingDiagonalLine(); |
49 void testCreatingDiagonalLine(); |
124 |
123 |
125 //2) |
124 //2) |
126 testStatusStrip = new CalenDayStatusStrip(); |
125 testStatusStrip = new CalenDayStatusStrip(); |
127 QVERIFY(testStatusStrip); |
126 QVERIFY(testStatusStrip); |
128 delete testStatusStrip; |
127 delete testStatusStrip; |
129 } |
|
130 |
|
131 /*! |
|
132 Test function for geting and setting color |
|
133 1. Test setting red color |
|
134 2. Test change color to blue |
|
135 */ |
|
136 void TestCalenStatusStrip::testSetGetColor() |
|
137 { |
|
138 //1) |
|
139 mStatusStrip->setColor(QColor(Qt::red)); |
|
140 QColor testColor = mStatusStrip->color(); |
|
141 QCOMPARE(QColor(Qt::red),testColor); |
|
142 |
|
143 //2) |
|
144 mStatusStrip->setColor(QColor(Qt::blue)); |
|
145 testColor = mStatusStrip->color(); |
|
146 QCOMPARE(QColor(Qt::blue),testColor); |
|
147 } |
128 } |
148 |
129 |
149 /*! |
130 /*! |
150 Test function for geting and setting range |
131 Test function for geting and setting range |
151 1. Test setting 5px range |
132 1. Test setting 5px range |
337 created so user can see if it draw in good way. |
318 created so user can see if it draw in good way. |
338 */ |
319 */ |
339 void TestCalenStatusStrip::testPaint() |
320 void TestCalenStatusStrip::testPaint() |
340 { |
321 { |
341 //preapre data needed to draw on widget |
322 //preapre data needed to draw on widget |
342 mStatusStrip->setColor(QColor(Qt::red)); |
|
343 QPair<QTime, QTime> startEndTime; |
323 QPair<QTime, QTime> startEndTime; |
344 startEndTime.first = QTime(10,20,0); |
324 startEndTime.first = QTime(10,20,0); |
345 startEndTime.second = QTime(15,10,00); |
325 startEndTime.second = QTime(15,10,00); |
346 |
326 |
347 //set event time |
327 //set event time |