Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added first set of tests for property names with a semi-colon in.
[xestiacalendar/.git] / source / tests / xestiacalendar_commonfunctions.h
1 #include "../common/file.h"
2 #include "../common/text.h"
4 TEST(CommonFunctions, FileTests){
5         
6         ASSERT_EQ(false, FileExists("iCalendarEvent-Missing.vcf"));
7         ASSERT_EQ(true, FileExists("iCalendarEvent-InvalidPermissions.vcf"));
8         
9 }
11 TEST(CommonFunctions, ProcessTextVectorsTests){
12         
13         // Setup the objects to be used for processing.
14         
15         vector<string> TextPropertiesExample1;
16         vector<string> TextValueExample1;
17         multimap<string, string> TextExample1TestResult;
18         
19         TextPropertiesExample1.push_back("ATTENDEE");
20         TextValueExample1.push_back("Example Attendee 1");
22         TextPropertiesExample1.push_back("ATTENDEE");
23         TextValueExample1.push_back("Example Attendee 2");
24         
25         TextPropertiesExample1.push_back("ATTENDEE");
26         TextValueExample1.push_back("Example Attendee 3");
27         
28         TextPropertiesExample1.push_back("CATEGORIES");
29         TextValueExample1.push_back("CATEGORY 1");
31         TextPropertiesExample1.push_back("CATEGORIES");
32         TextValueExample1.push_back("CATEGORY 2");
33         
34         TextPropertiesExample1.push_back("CATEGORIES");
35         TextValueExample1.push_back("CATEGORY 3");
37         TextPropertiesExample1.push_back("COMMENT");
38         TextValueExample1.push_back("This is the first comment.");
40         TextPropertiesExample1.push_back("COMMENT");
41         TextValueExample1.push_back("This is the second comment.");
42         
43         TextPropertiesExample1.push_back("COMMENT");
44         TextValueExample1.push_back("This is the third comment.");
46         TextPropertiesExample1.push_back("CONTACT;TEST=VALUE");
47         TextValueExample1.push_back("First Contact");
49         TextPropertiesExample1.push_back("CONTACT;LAZY=NOPE");
50         TextValueExample1.push_back("Second Contact");
52         TextPropertiesExample1.push_back("CONTACT;SETUP=NO");
53         TextValueExample1.push_back("Third Contact");
55         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
56         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
57         TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3"));
58         
59         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE"));
61         TextExample1TestResult.clear();
62         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
63         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
64         TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 3"));
66         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES"));
68         TextExample1TestResult.clear();
69         TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
70         TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
71         TextExample1TestResult.insert(make_pair("COMMENT", "This is the third comment."));
72         
73         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT"));
75         TextExample1TestResult.clear();
76         TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact"));
77         TextExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact"));
78         TextExample1TestResult.insert(make_pair("CONTACT;SETUP=NO", "Third Contact"));
79         
80         ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CONTACT"));
82 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy