|
1 /* |
|
2 * Copyright (c) 2006 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: CommandHandlerSortOrder unit test cases |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __UT_CGLXCOMMANDHANDLERSORTORDER_H__ |
|
22 #define __UT_CGLXCOMMANDHANDLERSORTORDER_H__ |
|
23 #include <mglxmedialistprovider.h> |
|
24 |
|
25 // EXTERNAL INCLUDES |
|
26 #include <digia/eunit/ceunittestsuiteclass.h> |
|
27 #include <digia/eunit/eunitdecorators.h> |
|
28 |
|
29 #include <mglxmedialistprovider.h> |
|
30 |
|
31 // INTERNAL INCLUDES |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class MGlxMediaList; |
|
36 class CGlxCommandHandlerSortOrder; |
|
37 |
|
38 |
|
39 // CLASS DEFINITION |
|
40 /** |
|
41 * TODO Auto-generated EUnit test suite |
|
42 * |
|
43 */ |
|
44 NONSHARABLE_CLASS( ut_cglxcommandhandlersortorder ) |
|
45 : public CEUnitTestSuiteClass, public MGlxMediaListProvider |
|
46 { |
|
47 public: // Constructors and destructors |
|
48 |
|
49 /** |
|
50 * Two phase construction |
|
51 */ |
|
52 static ut_cglxcommandhandlersortorder* NewL(); |
|
53 static ut_cglxcommandhandlersortorder* NewLC(); |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 ~ut_cglxcommandhandlersortorder(); |
|
58 |
|
59 private: // Constructors and destructors |
|
60 |
|
61 ut_cglxcommandhandlersortorder(); |
|
62 void ConstructL(); |
|
63 |
|
64 public: // From MGlxMediaListProvider |
|
65 |
|
66 MGlxMediaList& MediaList(); |
|
67 |
|
68 private: // New methods |
|
69 |
|
70 // With medialist owner (filters applied) & valid setting key |
|
71 void SetupMethod1L(); |
|
72 |
|
73 // With medialist owner (without filters) & valid setting key |
|
74 void SetupMethod2L(); |
|
75 |
|
76 // With medialist owner as NULL & valid setting key |
|
77 void SetupMethod3L(); |
|
78 |
|
79 // With medialist owner (filters applied) & invalid setting key |
|
80 void SetupMethod4L(); |
|
81 |
|
82 // Clean up code |
|
83 void Teardown(); |
|
84 |
|
85 // Test command handler creation |
|
86 void T_TestCreationL(); |
|
87 |
|
88 // Test alphabetical sort |
|
89 void T_TestAlphaSortL(); |
|
90 |
|
91 // Test alphabetical sort where the Medialist is NULL |
|
92 void T_TestAlphaSortWithNullListL(); |
|
93 |
|
94 // Test Frequency sort |
|
95 void T_TestFrequencySortL(); |
|
96 |
|
97 // Test Frequency sort where the Medialist is NULL |
|
98 void T_TestFrequencySortWithNullListL(); |
|
99 |
|
100 // Test an invalid command with the command handler |
|
101 void T_TestInvalidSortL(); |
|
102 |
|
103 // Test disable of alphabetical sort menu option |
|
104 void T_TestDisableAlphaL(); |
|
105 |
|
106 // Test disable of alphabetical sort menu option where the Medialist is NULL |
|
107 void T_TestDisableAlphaWithNullListL(); |
|
108 |
|
109 // Test disable of frequency sort menu option |
|
110 void T_TestDisableFrequencyL(); |
|
111 |
|
112 // Test disable of frequency sort menu option where the Medialist is NULL |
|
113 void T_TestDisableFrequencyWithNullListL(); |
|
114 |
|
115 // Test menu disable with invalid command id |
|
116 void T_TestDisableInvalidCommandL(); |
|
117 |
|
118 private: // Data |
|
119 |
|
120 CGlxCommandHandlerSortOrder* iCommand; |
|
121 MGlxMediaList* iMediaList; |
|
122 TBool iFilterFlag; |
|
123 |
|
124 EUNIT_DECLARE_TEST_TABLE; |
|
125 |
|
126 }; |
|
127 |
|
128 #endif // __UT_CGLXCOMMANDHANDLERSORTORDER_H__ |
|
129 |
|
130 // End of file |