Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added third set of tests for ProcessTextVectorsTests
[xestiacalendar/.git] / source / tests / xestiacalendar_commonfunctions.h
index 74f0125..7315d54 100644 (file)
@@ -1,8 +1,66 @@
 #include "../common/file.h"
+#include "../common/text.h"
 
 TEST(CommonFunctions, FileTests){
        
        ASSERT_EQ(false, FileExists("iCalendarEvent-Missing.vcf"));
        ASSERT_EQ(true, FileExists("iCalendarEvent-InvalidPermissions.vcf"));
        
+}
+
+TEST(CommonFunctions, ProcessTextVectorsTests){
+       
+       // Setup the objects to be used for processing.
+       
+       vector<string> TextPropertiesExample1;
+       vector<string> TextValueExample1;
+       multimap<string, string> TextExample1TestResult;
+       
+       TextPropertiesExample1.push_back("ATTENDEE");
+       TextValueExample1.push_back("Example Attendee 1");
+
+       TextPropertiesExample1.push_back("ATTENDEE");
+       TextValueExample1.push_back("Example Attendee 2");
+       
+       TextPropertiesExample1.push_back("ATTENDEE");
+       TextValueExample1.push_back("Example Attendee 3");
+       
+       TextPropertiesExample1.push_back("CATEGORIES");
+       TextValueExample1.push_back("CATEGORY 1");
+
+       TextPropertiesExample1.push_back("CATEGORIES");
+       TextValueExample1.push_back("CATEGORY 2");
+       
+       TextPropertiesExample1.push_back("CATEGORIES");
+       TextValueExample1.push_back("CATEGORY 3");
+
+       TextPropertiesExample1.push_back("COMMENT");
+       TextValueExample1.push_back("This is the first comment.");
+
+       TextPropertiesExample1.push_back("COMMENT");
+       TextValueExample1.push_back("This is the second comment.");
+       
+       TextPropertiesExample1.push_back("COMMENT");
+       TextValueExample1.push_back("This is the third comment.");
+
+       TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1"));
+       TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2"));
+       TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3"));
+       
+       ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE"));
+
+       TextExample1TestResult.clear();
+       TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1"));
+       TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2"));
+       TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 3"));
+
+       ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES"));
+
+       TextExample1TestResult.clear();
+       TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment."));
+       TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment."));
+       TextExample1TestResult.insert(make_pair("COMMENT", "This is the third comment."));
+       
+       ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT"));
+
 }
\ No newline at end of file
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