From: Steve Brokenshire Date: Sun, 31 Jan 2016 18:05:18 +0000 (+0000) Subject: Added unit tests for UID, CONTACT and DTSTART in iCalendarJournal/ObjectDataTests. X-Git-Tag: release-0.02~428 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=inline;h=285ca29f0d2706bd83fac56a7b8be66a56e6079f;p=xestiacalendar%2F.git Added unit tests for UID, CONTACT and DTSTART in iCalendarJournal/ObjectDataTests. --- diff --git a/source/tests/xestiacalendar_icalfreebusyload.h b/source/tests/xestiacalendar_icalfreebusyload.h index e0b63aa..76bd923 100644 --- a/source/tests/xestiacalendar_icalfreebusyload.h +++ b/source/tests/xestiacalendar_icalfreebusyload.h @@ -39,4 +39,52 @@ TEST(iCalendarFreeBusy, ObjectDataTests){ ASSERT_EQ("20160131T173000Z", TestFreeBusy.DateTimeStampData); ASSERT_EQ("OTHER=PARAM", TestFreeBusy.DateTimeStampTokens); + // Tests for UID. + + ASSERT_EQ("b3a16392-ad86-4061-be53-c215af2306ff", TestFreeBusy.UniqueID); + ASSERT_EQ("UNIQUEPARAM=CERTAINLY;OKAY=MAYBENOT", TestFreeBusy.UniqueIDTokens); + + // Tests for CONTACT. + + std::string ContactData; + std::string ContactDataAltRep; + std::string ContactDataLanguage; + std::string ContactDataTokens; + + if (TestFreeBusy.ContactList.size() > 0){ + + ContactData = TestFreeBusy.ContactList[0]; + + } + + if (TestFreeBusy.ContactList.size() > 0){ + + ContactDataAltRep = TestFreeBusy.ContactListAltRep[0]; + + } + + if (TestFreeBusy.ContactList.size() > 0){ + + ContactDataLanguage = TestFreeBusy.ContactListLanguage[0]; + + } + + if (TestFreeBusy.ContactList.size() > 0){ + + ContactDataTokens = TestFreeBusy.ContactListTokens[0]; + + } + + ASSERT_EQ("Contact Person", ContactData); + ASSERT_EQ("null:nodata", ContactDataAltRep); + ASSERT_EQ("en-GB", ContactDataLanguage); + ASSERT_EQ("EXAMPLE=TOKEN", ContactDataTokens); + + // Tests for DTSTART. + + ASSERT_EQ("20160131T103000Z", TestFreeBusy.DateTimeStartData); + ASSERT_EQ("DATE-TIME", TestFreeBusy.DateTimeStartDataValue); + ASSERT_EQ("Europe/Truro", TestFreeBusy.DateTimeStartDataTimeZoneID); + ASSERT_EQ("PARAMONE=YES;PARAMTWO=NO", TestFreeBusy.DateTimeStartDataTokens); + } \ No newline at end of file