calendarui/views/dayview/tsrc/unittests/unittest_calendayinfo/unittest_calendayinfo.cpp
changeset 45 b6db4fd4947b
child 57 bb2d3e476f29
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
       
     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: Test class for CalenDayContentWidget
       
    15  *
       
    16  */
       
    17 #include <QGraphicsItem>
       
    18 #include <QtTest/QtTest>
       
    19 
       
    20 
       
    21 #include <HbMainWindow>
       
    22 
       
    23 #include "calendayinfo.h"
       
    24 #include "calendaycommonheaders.h"
       
    25 
       
    26 class TestCalenDayInfo : public QObject
       
    27 {
       
    28 Q_OBJECT
       
    29 
       
    30 public:
       
    31     TestCalenDayInfo();
       
    32     virtual ~TestCalenDayInfo();
       
    33 
       
    34 private slots:
       
    35     void initTestCase();
       
    36     void cleanupTestCase();
       
    37     void init();
       
    38     void cleanup();
       
    39 
       
    40     void testConstructors();
       
    41 
       
    42 private:
       
    43     CalenDayInfo *mInfo;
       
    44 };
       
    45 
       
    46 /*!
       
    47  Constructor
       
    48  */
       
    49 TestCalenDayInfo::TestCalenDayInfo() :
       
    50    mInfo(NULL)
       
    51 {
       
    52 
       
    53 }
       
    54 
       
    55 /*!
       
    56  Destructor
       
    57  */
       
    58 TestCalenDayInfo::~TestCalenDayInfo()
       
    59 {
       
    60 
       
    61 }
       
    62 
       
    63 /*!
       
    64  Called before testcase
       
    65  */
       
    66 void TestCalenDayInfo::initTestCase()
       
    67 {
       
    68 }
       
    69 
       
    70 /*!
       
    71  Called after testcase
       
    72  */
       
    73 void TestCalenDayInfo::cleanupTestCase()
       
    74 {
       
    75 
       
    76 }
       
    77 
       
    78 /*!
       
    79  Called before every function
       
    80  */
       
    81 void TestCalenDayInfo::init()
       
    82 {
       
    83     mInfo = new CalenDayInfo(CalenDayInfo::ETwo);
       
    84 }
       
    85 
       
    86 /*!
       
    87  Called after everyfunction
       
    88  */
       
    89 void TestCalenDayInfo::cleanup()
       
    90 {
       
    91     if (mInfo) {
       
    92         delete mInfo;
       
    93         mInfo = NULL;
       
    94     }
       
    95 }
       
    96 
       
    97 /*!
       
    98  Test function for constructors
       
    99  1. Test if CalenDayInfo is not initialized
       
   100  2. Test if CalenDayInfo is correcty created
       
   101  */
       
   102 void TestCalenDayInfo::testConstructors()
       
   103 {
       
   104     //1)
       
   105     CalenDayInfo *testCalenDayInfo = 0;
       
   106     QVERIFY(!testCalenDayInfo);
       
   107     
       
   108     //2)
       
   109     testCalenDayInfo = new CalenDayInfo(CalenDayInfo::ETwo);
       
   110     QVERIFY(testCalenDayInfo);
       
   111 }
       
   112 
       
   113 
       
   114 QTEST_MAIN(TestCalenDayInfo);
       
   115 
       
   116 #include "unittest_calendayinfo.moc"