X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaleventload.h;h=baff32a9086c2ec2abe470f3e1d0bdadfac23624;hb=f53595647be46dd59b042f252d6aa9a0f744d420;hp=87f7bd51474da02fe1aadc47826884214fe1f9ed;hpb=9f7f29785a32214fba84df27c2e88de11cf1de6f;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 87f7bd5..baff32a 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -78,5 +78,100 @@ 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); + + // Tests for LAST-MODIFIED. + + ASSERT_EQ("20160124T093000Z", TestEvent.LastModifiedData); + ASSERT_EQ("FUTURE=ODD", TestEvent.LastModifiedTokens); + + // Tests for LOCATION. + + ASSERT_EQ("The Basement, Truro", TestEvent.LocationData); + ASSERT_EQ("null:nodata", TestEvent.LocationDataAltRep); + ASSERT_EQ("kw", TestEvent.LocationDataLanguage); + ASSERT_EQ("EXACT=NO", TestEvent.LocationDataTokens); + + // Tests for ORGANIZER. + + ASSERT_EQ("mailto:organiser@example.com", TestEvent.OrganiserData); + ASSERT_EQ("ExampleOrganiser", TestEvent.OrganiserDataCommonName); + ASSERT_EQ("null:nodata", TestEvent.OrganiserDataDirectoryEntry); + ASSERT_EQ("mailto:organiser.noreply@example.com", TestEvent.OrganiserDataSentByParam); + ASSERT_EQ("kw", TestEvent.OrganiserDataLanguage); + ASSERT_EQ("HAPPY=DAYS", TestEvent.OrganiserDataTokens); + + // Tests for PRIORITY. + + ASSERT_EQ(5, TestEvent.PriorityData); + ASSERT_EQ("STATUS=DEFAULT", TestEvent.PriorityTokens); + + // Tests for SEQUENCE. + + ASSERT_EQ(3, TestEvent.SequenceData); + ASSERT_EQ("TEST=YAY", TestEvent.SequenceTokens); + + // Tests for STATUS. + + ASSERT_EQ("2.0;Success", TestEvent.RequestStatusData); + ASSERT_EQ("kw", TestEvent.RequestStatusLanguage); + ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestEvent.RequestStatusTokens); + + // Tests for SUMMARY. + + ASSERT_EQ("A summary of the event.", TestEvent.SummaryData); + ASSERT_EQ("null:nodata", TestEvent.SummaryDataAltRep); + ASSERT_EQ("kw", TestEvent.SummaryDataLanguage); + ASSERT_EQ("FAVOURITE=TOFU;NOTLIKE=NONE", TestEvent.SummaryDataTokens); + + // Tests for TRANSP. + + ASSERT_EQ("TRANSPARENT", TestEvent.TimeTransparencyData); + ASSERT_EQ("OPAQUE=NOTYET", TestEvent.TimeTransparencyDataTokens); + + // Tests for URL. + + ASSERT_EQ("http://www.example.com/", TestEvent.URLData); + ASSERT_EQ("EXTERNAL=YES", TestEvent.URLDataTokens); + + // Tests for RECURRENCE-ID. + + ASSERT_EQ("20160124", TestEvent.RecurranceIDData); + ASSERT_EQ("Europe/Truro", TestEvent.RecurranceIDDataTimeZoneParam); + ASSERT_EQ("THISANDFUTURE", TestEvent.RecurranceIDDataRangeParam); + ASSERT_EQ("DATE", TestEvent.RecurranceIDDataValue); + ASSERT_EQ("EXAMPLE=DATA", TestEvent.RecurranceIDDataTokens); } \ No newline at end of file