From a58210730137cbd41ab3a450c12b99b3b382e142 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 23 Jan 2016 11:05:32 +0000 Subject: [PATCH] Added ProcessTextVectorsTests unit tests in CommonFunctions --- source/tests/xestiacalendar_commonfunctions.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index 74f0125..62a8aee 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -1,8 +1,35 @@ #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 TextPropertiesExample1; + vector TextValueExample1; + //multimap TextExample1Results; + multimap TextExample1TestResult1; + + 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"); + + TextExample1TestResult1.insert(make_pair("ATTENDEE", "Example Attendee 1")); + TextExample1TestResult1.insert(make_pair("ATTENDEE", "Example Attendee 2")); + TextExample1TestResult1.insert(make_pair("ATTENDEE", "Example Attendee 3")); + + ASSERT_EQ(TextExample1TestResult1, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "ATTENDEE")); + } \ No newline at end of file -- 2.39.5