calendarui/views/dayview/tsrc/unittests/unittest_calendaycontainer/unittest_calendaycontainer.cpp
changeset 81 ce92091cbd61
parent 57 bb2d3e476f29
child 83 5aadd1120515
--- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontainer/unittest_calendaycontainer.cpp	Mon Sep 20 12:44:39 2010 +0530
+++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontainer/unittest_calendaycontainer.cpp	Tue Oct 05 13:57:00 2010 +0530
@@ -22,10 +22,10 @@
 
 #include "calendayinfo.h"
 #include "calendaymodel.h"
+#include "calendayitem.h"
 
 #define private public
 
-
 #include "calendaycontainertest.h"
 
 QVariantList MOCK_EVENTS_LIST; 
@@ -51,6 +51,7 @@
 
     void testConstructors();
     void testSetGetDayInfo();
+    void testSetGetDate();
     void testItemAdded();
     void testItemRemoved();
     void testReset();
@@ -182,11 +183,30 @@
 }
 
 /*!
+   Test function to check set and get date
+   1) Test setDate()
+   2) Test date()
+ */
+void TestCalenDayContainer::testSetGetDate() 
+{
+    QDate today = QDate::currentDate();
+    
+    //1)
+    mContainer->setDate(today);
+    QCOMPARE(mContainer->mDate, today);
+    
+    //2)
+    QCOMPARE(mContainer->date(), today);
+}
+
+/*!
    Function not implemented
  */
 void TestCalenDayContainer::testItemAdded()
 {
-    //function dosen't do nothing. It will be updated after code changes
+    // function does nothing - just check function call
+    CalenDayItem *item = new CalenDayItem(mContainer);
+    mContainer->itemAdded(1, item, false);
 }
 
 /*!
@@ -194,7 +214,9 @@
  */
 void TestCalenDayContainer::testItemRemoved()
 {
-    //function dosen't do nothing. It will be updated after code changes
+    // function does nothing - just check function call
+    CalenDayItem *item = new CalenDayItem(mContainer);
+    mContainer->itemRemoved(item, false);
 }
 
 /*!