X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Ftests%2Fxestiacalendar_icaleventload.h;h=4e57b360722304697d01522330a979a04b199520;hb=3e4f324f276ea7a2fee3938d6f0d25c6e7af80ba;hp=48424f5ab8b26941ea734c8c7149d7c906704ca6;hpb=774a43b99cce55c69d1b815249491443c7f6f0ee;p=xestiacalendar%2F.git diff --git a/source/tests/xestiacalendar_icaleventload.h b/source/tests/xestiacalendar_icaleventload.h index 48424f5..4e57b36 100644 --- a/source/tests/xestiacalendar_icaleventload.h +++ b/source/tests/xestiacalendar_icaleventload.h @@ -145,9 +145,9 @@ TEST(iCalendarEvent, ObjectDataTests){ // Tests for STATUS. - ASSERT_EQ("2.0;Success", TestEvent.RequestStatusData); - ASSERT_EQ("kw", TestEvent.RequestStatusLanguage); - ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestEvent.RequestStatusTokens); + ASSERT_EQ("2.0;Success", TestEvent.StatusData); + ASSERT_EQ("kw", TestEvent.StatusLanguage); + ASSERT_EQ("FAVOURITE=RICHTEA;NOTLIKE=UNKNOWN", TestEvent.StatusTokens); // Tests for SUMMARY. @@ -534,4 +534,128 @@ TEST(iCalendarEvent, ObjectDataTests){ ASSERT_EQ("This is the third comment.", CommentData); ASSERT_EQ("ZEBRAS=YES", CommentDataTokens); + // Get the first CONTACT. + + std::string ContactData; + + if (TestEvent.ContactList.begin() != TestEvent.ContactList.end()){ + + ContactData = TestEvent.ContactList[0]; + + } + + ASSERT_EQ("First Contact", ContactData); + + // Get the second CONTACT. + + ContactData.clear(); + + std::string ContactDataAltRep; + std::string ContactDataLanguage; + + if (TestEvent.ContactList.size() > 1){ + + ContactData = TestEvent.ContactList[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ContactDataAltRep = TestEvent.ContactListAltRep[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ContactDataLanguage = TestEvent.ContactListLanguage[1]; + + } + + ASSERT_EQ("Second Contact", ContactData); + ASSERT_EQ("null:nodata", ContactDataAltRep); + ASSERT_EQ("en-GB", ContactDataLanguage); + + // Get the third CONTACT. + + ContactData.clear(); + + std::string ContactDataTokens; + + if (TestEvent.ContactList.size() > 2){ + + ContactData = TestEvent.ContactList[2]; + + } + + if (TestEvent.ContactList.size() > 2){ + + ContactDataTokens = TestEvent.ContactListTokens[2]; + + } + + ASSERT_EQ("Third Contact", ContactData); + ASSERT_EQ("ZEBRAS=NO", ContactDataTokens); + + // Get the first EXDATE. + + std::string ExcludeDate; + + if (TestEvent.ExcludeDateData.begin() != TestEvent.ExcludeDateData.end()){ + + ExcludeDate = TestEvent.ExcludeDateData[0]; + + } + + ASSERT_EQ("20160125T120000Z", ExcludeDate); + + // Get the second EXDATE. + + ExcludeDate.clear(); + + std::string ExcludeDataTimeZoneParam; + std::string ExcludeDataValue; + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDate = TestEvent.ExcludeDateData[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDataTimeZoneParam = TestEvent.ExcludeDateDataTimeZoneParam[1]; + + } + + if (TestEvent.ContactList.size() > 1){ + + ExcludeDataValue = TestEvent.ExcludeDateDataValue[1]; + + } + + ASSERT_EQ("20160125T130000Z", ExcludeDate); + ASSERT_EQ("DATE-TIME", ExcludeDataValue); + ASSERT_EQ("Europe/Truro", ExcludeDataTimeZoneParam); + + // Get the third EXDATE. + + ExcludeDate.clear(); + + std::string ExcludeDataTokens; + + if (TestEvent.ContactList.size() > 2){ + + ExcludeDate = TestEvent.ExcludeDateData[2]; + + } + + if (TestEvent.ContactList.size() > 2){ + + ExcludeDataTokens = TestEvent.ExcludeDateDataTokens[2]; + + } + + ASSERT_EQ("20160125T133000Z", ExcludeDate); + ASSERT_EQ("ZOOP=ZIPPO", ExcludeDataTokens); + } \ No newline at end of file