X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_commonfunctions.h;h=22ea5d4655b6477ff5340596bfa4bcf1f41412ba;hb=c79fde81cd023afb49757695c34b56ff594b5e2d;hp=7315d54e2db052aa7d4e04aaf4dd9fc6dbac1bb1;hpb=a67a186a2e6bef3213619106df28c71b13ac9711;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_commonfunctions.h b/source/tests/xestiacalendar_commonfunctions.h index 7315d54..22ea5d4 100644 --- a/source/tests/xestiacalendar_commonfunctions.h +++ b/source/tests/xestiacalendar_commonfunctions.h @@ -43,12 +43,44 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ TextPropertiesExample1.push_back("COMMENT"); TextValueExample1.push_back("This is the third comment."); + TextPropertiesExample1.push_back("CONTACT;TEST=VALUE"); + TextValueExample1.push_back("First Contact"); + + TextPropertiesExample1.push_back("CONTACT;LAZY=NOPE"); + TextValueExample1.push_back("Second Contact"); + + TextPropertiesExample1.push_back("CONTACT;SETUP=NO"); + TextValueExample1.push_back("Third Contact"); + + TextPropertiesExample1.push_back("RESOURCES;ROOM=YES"); + TextValueExample1.push_back("First Resource Widget"); + + TextPropertiesExample1.push_back("RESOURCES;ROOM=NO"); + TextValueExample1.push_back("Second Resource Widget"); + + TextPropertiesExample1.push_back("RESOURCES;ROOM=UNKNOWN"); + TextValueExample1.push_back("Third Resource Widget"); + + TextPropertiesExample1.push_back("RELATED;RELATION=NO"); + TextValueExample1.push_back("First Relation"); + + TextPropertiesExample1.push_back("RELATED;RELATION=YES"); + TextValueExample1.push_back("Second Relation"); + + TextPropertiesExample1.push_back("RELATED;RELATION=MAYBE"); + TextValueExample1.push_back("Third Relation"); + 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("ATTENDEE", "Example Attendee 1")); + + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "ATTENDEE")); + TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1")); TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 2")); @@ -56,6 +88,11 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CATEGORIES")); + TextExample1TestResult.clear(); + TextExample1TestResult.insert(make_pair("CATEGORIES", "CATEGORY 1")); + + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, false, "CATEGORIES")); + TextExample1TestResult.clear(); TextExample1TestResult.insert(make_pair("COMMENT", "This is the first comment.")); TextExample1TestResult.insert(make_pair("COMMENT", "This is the second comment.")); @@ -63,4 +100,25 @@ TEST(CommonFunctions, ProcessTextVectorsTests){ ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "COMMENT")); + TextExample1TestResult.clear(); + TextExample1TestResult.insert(make_pair("CONTACT;TEST=VALUE", "First Contact")); + TextExample1TestResult.insert(make_pair("CONTACT;LAZY=NOPE", "Second Contact")); + TextExample1TestResult.insert(make_pair("CONTACT;SETUP=NO", "Third Contact")); + + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "CONTACT")); + + TextExample1TestResult.clear(); + TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=YES", "First Resource Widget")); + TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=NO", "Second Resource Widget")); + TextExample1TestResult.insert(make_pair("RESOURCES;ROOM=UNKNOWN", "Third Resource Widget")); + + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RESOURCES")); + + TextExample1TestResult.clear(); + TextExample1TestResult.insert(make_pair("RELATED;RELATION=NO", "First Relation")); + TextExample1TestResult.insert(make_pair("RELATED;RELATION=YES", "Second Relation")); + TextExample1TestResult.insert(make_pair("RELATED;RELATION=MAYBE", "Third Relation")); + + ASSERT_EQ(TextExample1TestResult, ProcessTextVectors(&TextPropertiesExample1, &TextValueExample1, true, "RELATED")); + } \ No newline at end of file