From abbabe53be45daff42ce81c4d08c1687e82f567f Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 27 Jan 2016 21:35:37 +0000 Subject: [PATCH] Added unit tests for RESOURCES in iCalendarEvent/ObjectDataTests. --- source/tests/xestiacalendar_icaleventload.h | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 89e33d5..a0227a8 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -766,4 +766,66 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("person.3@example.com", RelatedTo); ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens); + // Get the first RESOURCES. + + std::string Resources; + + if (TestEvent.ResourcesData.begin() != TestEvent.ResourcesData.end()){ + + Resources = TestEvent.ResourcesData[0]; + + } + + ASSERT_EQ("DMAC RECEIVER", Resources); + + // Get the second RESOURCES. + + Resources.clear(); + + std::string ResourcesLanguage; + + if (TestEvent.ResourcesData.size() > 1){ + + Resources = TestEvent.ResourcesData[1]; + + } + + if (TestEvent.ResourcesData.size() > 1){ + + ResourcesLanguage = TestEvent.ResourcesDataLanguage[1]; + + } + + ASSERT_EQ("PAL-I TELEVISION SET", Resources); + ASSERT_EQ("en", ResourcesLanguage); + + // Get the third RESOURCES. + + Resources.clear(); + + std::string ResourcesAltRep; + std::string ResourcesTokens; + + if (TestEvent.ResourcesData.size() > 2){ + + Resources = TestEvent.ResourcesData[2]; + + } + + if (TestEvent.ResourcesData.size() > 2){ + + ResourcesAltRep = TestEvent.ResourcesDataAltRep[2]; + + } + + if (TestEvent.ResourcesData.size() > 2){ + + ResourcesTokens = TestEvent.ResourcesDataTokens[2]; + + } + + ASSERT_EQ("PAL/SECAM VCR", Resources); + ASSERT_EQ("null:nodata", ResourcesAltRep); + ASSERT_EQ("STATUS=BROKEN", ResourcesTokens); + } \ No newline at end of file -- 2.39.5