From c3a43f492e9eb3003693d165a8c057b2a89f9d64 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sat, 23 Jan 2016 13:12:40 +0000 Subject: [PATCH] Added comments detailing unit tests in ProcessTextVectorsTests. --- source/tests/xestiacalendar_commonfunctions.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index 21ea604..ca7269b 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -70,6 +70,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ TextPropertiesExample1.push_back("RELATED;RELATION=MAYBE"); TextValueExample1.push_back("Third Relation"); + // Examples 1 & 2: ATTENDEE + TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 1")); TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 2")); TextExample1TestResult.insert(make_pair("ATTENDEE", "Example Attendee 3")); @@ -81,6 +83,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "ATTENDEE")); + // Examples 3 & 4: CATEGORIES + TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1")); TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2")); @@ -91,6 +95,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1")); + // Examples 5 & 6: COMMENT + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CATEGORIES")); TextExample1TestResult.clear(); @@ -103,6 +109,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment.")); + // Examples 7 & 8: CONTACT;(properties) + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "COMMENT")); TextExample1TestResult.clear(); @@ -115,6 +123,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact")); + // Examples 9 & 10: RESOURCES;(properties) + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CONTACT")); TextExample1TestResult.clear(); @@ -129,6 +139,8 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "RESOURCES")); + // Examples 11 & 12: RELATED;(properties) + TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation")); TextExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation")); -- 2.39.5