|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __T_AGENT_H__ |
|
17 #define __T_AGENT_H__ |
|
18 |
|
19 class CAgentTest : public CBase |
|
20 { |
|
21 public: |
|
22 static CAgentTest* NewL(CCntTest& aTestLibrary); |
|
23 ~CAgentTest(); |
|
24 void RunTestsL(); |
|
25 private: |
|
26 CAgentTest(CCntTest& aTestLibrary); |
|
27 void ConstructL(); |
|
28 void AgentExportL(); |
|
29 void CompareFilesL(const TDesC& aOutputFile,const TDesC& aCompareFile); |
|
30 TBool CompareLines(const TDesC8& aLine1, const TDesC8& aLine2); |
|
31 void ImportContactsL(const TDesC& aFileName); |
|
32 void ExportContactsL(const TDesC& aFileName); |
|
33 void ImportContactsFromDescriptorL(const TDesC8& aVCard); |
|
34 void ImportAgentToEmptyDatabaseL(); |
|
35 void ImportAgentForMergeL(); |
|
36 void ImportAgentMiscL(); |
|
37 void ExportWithDeletedAgentL(); |
|
38 void MultipleAgentExportL(); |
|
39 void AddContactItemsL(TInt aCount); |
|
40 void MakeAgentL(TContactItemId aMainContactId, TContactItemId aAgentId); |
|
41 TInt GetAgentCountL(TContactItemId aContactId); |
|
42 TBool RemoveFieldFromContactL(TContactItemId aContactId, TUid aContactField); |
|
43 private: |
|
44 CCntTest& iTest; |
|
45 CContactDatabase* iDb; |
|
46 CContactIdArray* iIdArray; |
|
47 }; |
|
48 |
|
49 _LIT8(KAgentvCard, "BEGIN:VCARD\r\n" |
|
50 "VERSION:2.1\r\n" |
|
51 "REV:20061211T050714Z\r\n" |
|
52 "UID:86454f285939ae79-00e1020032b20762-1\r\n" |
|
53 "N:Testname;;;;\r\n" |
|
54 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
55 "END:VCARD\r\n" |
|
56 "BEGIN:VCARD\r\n" |
|
57 "VERSION:2.1\r\n" |
|
58 "REV:20061211T050714Z\r\n" |
|
59 "UID:86454f285939ae79-00e1020032b9494b-2\r\n" |
|
60 "N:Neo;;;;\r\n" |
|
61 "TEL;HOME;VOICE;CELL:755502\r\n" |
|
62 "AGENT:\r\n" |
|
63 "BEGIN:VCARD\r\n" |
|
64 "VERSION:2.1\r\n" |
|
65 "REV:20061211T050714Z\r\n" |
|
66 "UID:86454f285939ae79-00e1020032b20762-1\r\n" |
|
67 "N:Example1;;;;\r\n" |
|
68 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
69 "END:VCARD\r\n" |
|
70 "\r\n" |
|
71 "END:VCARD\r\n"); |
|
72 |
|
73 _LIT8(KMultipleAgentvCard, "BEGIN:VCARD\r\n" |
|
74 "VERSION:2.1\r\n" |
|
75 "REV:20061211T050714Z\r\n" |
|
76 "UID:86454f285939ae79-00e1020032b20762-1\r\n" |
|
77 "N:Testname;;;;\r\n" |
|
78 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
79 "AGENT:\r\n" |
|
80 "BEGIN:VCARD\r\n" |
|
81 "VERSION:2.1\r\n" |
|
82 "REV:20061211T050714Z\r\n" |
|
83 "UID:86454f285939ae79-00e1020032b20762-5\r\n" |
|
84 "N:Example1;;;;\r\n" |
|
85 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
86 "END:VCARD\r\n" |
|
87 "\r\n" |
|
88 "END:VCARD\r\n" |
|
89 "BEGIN:VCARD\r\n" |
|
90 "VERSION:2.1\r\n" |
|
91 "REV:20061211T050714Z\r\n" |
|
92 "UID:86454f285939ae79-00e1020032b9494b-2\r\n" |
|
93 "N:Neo;;;;\r\n" |
|
94 "TEL;HOME;VOICE;CELL:755502\r\n" |
|
95 "AGENT:\r\n" |
|
96 "BEGIN:VCARD\r\n" |
|
97 "VERSION:2.1\r\n" |
|
98 "REV:20061211T050714Z\r\n" |
|
99 "UID:86454f285939ae79-00e1020032b20762-3\r\n" |
|
100 "N:SymbianFoundation;;;;\r\n" |
|
101 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
102 "END:VCARD\r\n" |
|
103 "\r\n" |
|
104 "AGENT:\r\n" |
|
105 "BEGIN:VCARD\r\n" |
|
106 "VERSION:2.1\r\n" |
|
107 "REV:20061211T050714Z\r\n" |
|
108 "UID:86454f285939ae79-00e1020032b20762-4\r\n" |
|
109 "N:Architect;;;;\r\n" |
|
110 "TEL;HOME;VOICE;CELL:755501\r\n" |
|
111 "END:VCARD\r\n" |
|
112 "\r\n" |
|
113 "END:VCARD\r\n"); |
|
114 |
|
115 #endif |