videocollection/videocollectionview/tsrc/testvideolistselectiondialog/inc/testvideolistselectiondialog.h
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
    16 */
    16 */
    17 
    17 
    18 #ifndef __TESTVIDEOLISTSELECTIONDIALOG_H__
    18 #ifndef __TESTVIDEOLISTSELECTIONDIALOG_H__
    19 #define __TESTVIDEOLISTSELECTIONDIALOG_H__
    19 #define __TESTVIDEOLISTSELECTIONDIALOG_H__
    20 
    20 
    21 
       
    22 // INCLUDES
    21 // INCLUDES
    23 #include <QtTest/QtTest>
    22 #include <QtTest/QtTest>
       
    23 
       
    24 class VideoListSelectionDialog;
       
    25 class VideoCollectionUiLoader;
       
    26 class VideoListDataModel;
       
    27 class VideoSortFilterProxyModel;
       
    28 class VideoListWidget;
       
    29 class VideoListSelectionDialogTesterHelper;
    24 
    30 
    25 class TestVideoListSelectionDialog : public QObject
    31 class TestVideoListSelectionDialog : public QObject
    26 {
    32 {
    27     Q_OBJECT
    33     Q_OBJECT
    28 
    34 
       
    35 private:
       
    36     
       
    37     void setRowCount(int count, int type = 0, VideoListDataModel *model = 0);
       
    38     
    29     // test functions for the test framework
    39     // test functions for the test framework
    30    
    40 
    31 private slots:
    41 private slots:
    32    
    42 
       
    43     /**
       
    44      * called before anything else when test starts
       
    45      */
       
    46     void initTestCase();
       
    47 
       
    48     /**
       
    49      * will be called after testing ends
       
    50      *
       
    51      */
       
    52     void cleanupTestCase();
       
    53     
    33     /**
    54     /**
    34      * will be called before each testfunction is executed.
    55      * will be called before each testfunction is executed.
    35      *
    56      *
    36      */
    57      */
    37     void init(); 
    58     void init(); 
    38    
    59    
    39     /**
    60     /**
    40      * will be called after every testfunction.
    61      * will be called after every testfunction.
    41      *
    62      *
    42      */
    63      */
    43     void cleanup();    
    64     void cleanup();
       
    65     
       
    66     /**
       
    67      * Tests constructor and destructor.
       
    68      */
       
    69     void testConstructDestruct();
       
    70     
       
    71     /**
       
    72      * tests VideoListSelectionDialog::setupContent
       
    73      */
       
    74     void testSetupContent();
       
    75     
       
    76     /**
       
    77      * verifies failure cases in initDialog
       
    78      */
       
    79     void testSetupInitFailures();
       
    80     
       
    81     /**
       
    82      * tests VideoListSelectionDialog::exec
       
    83      */
       
    84     void testExec();
       
    85 
       
    86     /**
       
    87      * tests finishedSlot
       
    88      */
       
    89     void testFinishedSlot();
       
    90     
       
    91     /**
       
    92      * tests VideoListSelectionDialog::markAllStateChangedSlot
       
    93      */
       
    94     void testMarkAllStateChangedSlot();
       
    95 
       
    96     /**
       
    97      * tests VideoListSelectionDialog::selectionChangedSlot
       
    98      */
       
    99     void testSelectionChangedSlot();
       
   100 
       
   101     /**
       
   102      * tests VideoListSelectionDialog::singleItemSelectedSlot
       
   103      */
       
   104     void testSingleItemSelectedSlot();
       
   105 
       
   106     /**
       
   107      * tests VideoListSelectionDialog::initDialog
       
   108      */
       
   109     void testModelReadySlot();
       
   110 
       
   111     /**
       
   112      * tests VideoListSelectionDialog::updateCounterSlot
       
   113      */
       
   114     void testUpdateCounterSlot();
       
   115 
       
   116     /**
       
   117      * tests VideoListSelectionDialog::primaryActionTriggeredSlot
       
   118      */
       
   119     void testPrimaryActionTriggeredSlot();
       
   120     
       
   121     /**
       
   122      * tests VideoListSelectionDialog::getSelectedName
       
   123      */
       
   124     void testGetSelectedName();
       
   125     
    44 private:
   126 private:
       
   127 
       
   128     /**
       
   129      * test helper
       
   130      */
       
   131     VideoListSelectionDialogTesterHelper *mTestHelper;  
       
   132     
       
   133     /**
       
   134      * object under test
       
   135      */
       
   136     VideoListSelectionDialog *mTestObject;
       
   137     
       
   138     /**
       
   139      * dummy UI loader object
       
   140      */
       
   141     VideoCollectionUiLoader *mTestUiLoader;
       
   142     
       
   143     /**
       
   144      * dummy source model
       
   145      */
       
   146     VideoListDataModel *mSourceModel;
       
   147     
       
   148     /**
       
   149      * dummy model
       
   150      */
       
   151     VideoSortFilterProxyModel *mModel;
       
   152     
       
   153     /**
       
   154      * dummy widget
       
   155      */
       
   156     VideoListWidget *mTestWidget;
       
   157     
       
   158 	/**
       
   159  	 * flag indicating if last call to init succeeded.
       
   160  	 */
       
   161     bool mInitOk;
    45 };
   162 };
    46 
   163 
    47 
   164 
    48 #endif  // __TESTVIDEOCOLLECTIONVIEWUTILS_H__
   165 #endif  // __TESTVIDEOCOLLECTIONVIEWUTILS_H__
    49 
   166