|
1 /* |
|
2 * Copyright (c) 2010 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: Unit test class for QWERTY tables |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __UT_CQWERTYPREDICTIVESEARCHTABLE_H__ |
|
19 #define __UT_CQWERTYPREDICTIVESEARCHTABLE_H__ |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <digia/eunit/ceunittestsuiteclass.h> |
|
23 #include <digia/eunit/eunitmacros.h> |
|
24 #include <sqldb.h> |
|
25 #include "cntdef.h" // TContactItemId |
|
26 #include <QVector> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CQwertyPredictiveSearchTable; |
|
30 class CContactItem; |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // CLASS DEFINITION |
|
35 /** |
|
36 * Tester class for CQwertyPredictiveSearchTable. |
|
37 */ |
|
38 NONSHARABLE_CLASS( UT_CQwertyPredictiveSearchTable ): public CEUnitTestSuiteClass |
|
39 { |
|
40 public: // Constructors and destructors |
|
41 |
|
42 /** |
|
43 * Two phase construction |
|
44 */ |
|
45 static UT_CQwertyPredictiveSearchTable* NewL(); |
|
46 static UT_CQwertyPredictiveSearchTable* NewLC(); |
|
47 |
|
48 /** |
|
49 * Destructor |
|
50 */ |
|
51 ~UT_CQwertyPredictiveSearchTable(); |
|
52 |
|
53 private: // Constructors |
|
54 |
|
55 UT_CQwertyPredictiveSearchTable(); |
|
56 void ConstructL(); |
|
57 |
|
58 private: // Test case setup and teardown |
|
59 |
|
60 void SetupL(); |
|
61 void Teardown(); |
|
62 |
|
63 private: // Test functions |
|
64 |
|
65 void UT_CreateInDbLL(); |
|
66 void UT_UpdateLL(); |
|
67 void UT_DeleteLL(); |
|
68 |
|
69 private: // New functions |
|
70 QVector<TInt> InitTableVector() const; |
|
71 |
|
72 void AddContactL(TContactItemId aContactId, |
|
73 const TDesC& aFirstName = KNullDesC, |
|
74 const TDesC& aLastName = KNullDesC, |
|
75 const TDesC& aMail = KNullDesC, |
|
76 const TDesC& aMail2 = KNullDesC, |
|
77 const TDesC& aMail3 = KNullDesC); |
|
78 |
|
79 CContactItem* FillContactItemLC(TContactItemId aContactId, |
|
80 const TDesC& aFirstName = KNullDesC, |
|
81 const TDesC& aLastName = KNullDesC, |
|
82 const TDesC& aMail = KNullDesC, |
|
83 const TDesC& aMail2 = KNullDesC, |
|
84 const TDesC& aMail3 = KNullDesC) const; |
|
85 |
|
86 void CheckItemCountL(QVector<TInt> aCountInTables); |
|
87 |
|
88 private: // Data |
|
89 |
|
90 CQwertyPredictiveSearchTable* iTable; |
|
91 |
|
92 RSqlDatabase iDB; |
|
93 |
|
94 EUNIT_DECLARE_TEST_TABLE; |
|
95 }; |
|
96 |
|
97 #endif // __UT_CQWERTYPREDICTIVESEARCHTABLE_H__ |
|
98 |
|
99 // End of file |