From: Steve Brokenshire Date: Wed, 27 Jan 2016 21:01:54 +0000 (+0000) Subject: Added unit tests for RELATED-TO in iCalendarEvent/ObjectDataTests. X-Git-Tag: release-0.02~615 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=fdde55ede1ea228da599f831ba19afbcf5ad56ea;p=xestiacalendar%2F.git Added unit tests for RELATED-TO in iCalendarEvent/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index cc451ff..89e33d5 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -712,4 +712,58 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("3.7;Invalid calendar user", RequestStatus); ASSERT_EQ("USER=MISSING", RequestTokens); + // Get the first RELATED-TO. + + std::string RelatedTo; + + if (TestEvent.RelatedToData.begin() != TestEvent.RelatedToData.end()){ + + RelatedTo = TestEvent.RelatedToData[0]; + + } + + ASSERT_EQ("person.1@example.com", RelatedTo); + + // Get the second RELATED-TO. + + RelatedTo.clear(); + + std::string RelatedToType; + + if (TestEvent.RelatedToData.size() > 1){ + + RelatedTo = TestEvent.RelatedToData[1]; + + } + + if (TestEvent.RelatedToData.size() > 1){ + + RelatedToType = TestEvent.RelatedToDataRelationType[1]; + + } + + ASSERT_EQ("person.2@example.com", RelatedTo); + ASSERT_EQ("PARENT", RelatedToType); + + // Get the third RELATED-TO. + + RelatedTo.clear(); + + std::string RelatedToTokens; + + if (TestEvent.RelatedToData.size() > 2){ + + RelatedTo = TestEvent.RelatedToData[2]; + + } + + if (TestEvent.RelatedToData.size() > 2){ + + RelatedToTokens = TestEvent.RelatedToDataTokens[2]; + + } + + ASSERT_EQ("person.3@example.com", RelatedTo); + ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens); + } \ No newline at end of file