From 00eaa33b5ee0bbd98f0ca3bb618e1539bfb3bd78 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 24 Jan 2016 09:12:37 +0000 Subject: [PATCH] Added unit tests for DESCRIPTION and GEO for iCalendarEvent/ObjectDataTests --- source/tests/xestiacalendar_icaleventload.h | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 87f7bd5..96d40db 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -78,5 +78,38 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("20160123T081100Z", TestEvent.DateTimeCreatedData); ASSERT_EQ("CARAMEL=PLEASE", TestEvent.DateTimeCreatedTokens); + + // Tests for DESCRIPTION. + + std::string DescriptionData; + std::string DescriptionAltRep; + std::string DescriptionLanguage; + std::string DescriptionTokens; + + if (TestEvent.DescriptionList.begin() != TestEvent.DescriptionList.end()){ + DescriptionData = TestEvent.DescriptionList[0]; + } + + if (TestEvent.DescriptionListAltRep.begin() != TestEvent.DescriptionListAltRep.end()){ + DescriptionAltRep = TestEvent.DescriptionListAltRep[0]; + } + if (TestEvent.DescriptionListAltRep.begin() != TestEvent.DescriptionListAltRep.end()){ + DescriptionLanguage = TestEvent.DescriptionListLanguage[0]; + } + + if (TestEvent.DescriptionListTokens.begin() != TestEvent.DescriptionListTokens.end()){ + DescriptionTokens = TestEvent.DescriptionListTokens[0]; + } + + ASSERT_EQ("This is a description of the event.", DescriptionData); + ASSERT_EQ("null:nodata", DescriptionAltRep); + ASSERT_EQ("kw", DescriptionLanguage); + ASSERT_EQ("EXAMPLE=TOKEN;MOREDATA=YES", DescriptionTokens); + + // Tests for GEO. + + ASSERT_EQ("5.0;5.0", TestEvent.GeographicData); + ASSERT_EQ("EXAMPLE=MEEP", TestEvent.GeographicTokens); + } \ No newline at end of file -- 2.39.5