// 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.
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);
+
+ // Get the first REQUEST-STATUS.
+
+ std::string RequestStatus;
+
+ if (TestEvent.RequestStatusData.begin() != TestEvent.RequestStatusData.end()){
+
+ RequestStatus = TestEvent.RequestStatusData[0];
+
+ }
+
+ ASSERT_EQ("2.0;Success", RequestStatus);
+
+ // Get the second REQUEST-STATUS.
+
+ RequestStatus.clear();
+
+ std::string RequestLanguage;
+
+ if (TestEvent.ContactList.size() > 1){
+
+ RequestStatus = TestEvent.RequestStatusData[1];
+
+ }
+
+ if (TestEvent.ContactList.size() > 1){
+
+ RequestLanguage = TestEvent.RequestStatusLanguage[1];
+
+ }
+
+ ASSERT_EQ("3.42;Really big irrecoverable error caused by the user", RequestStatus);
+ ASSERT_EQ("en", RequestLanguage);
+
+ // Get the third REQUEST-STATUS.
+
+ RequestStatus.clear();
+
+ std::string RequestTokens;
+
+ if (TestEvent.ContactList.size() > 2){
+
+ RequestStatus = TestEvent.RequestStatusData[2];
+
+ }
+
+ if (TestEvent.ContactList.size() > 2){
+
+ RequestTokens = TestEvent.RequestStatusTokens[2];
+
+ }
+
+ ASSERT_EQ("3.7;Invalid calendar user", RequestStatus);
+ ASSERT_EQ("USER=MISSING", RequestTokens);
+
+ // Get the first RELATED-TO.
+
+ std::string RelatedTo;
+
+ if (TestEvent.RelatedToData.begin() != TestEvent.RelatedToData.end()){
+
+ RelatedTo = TestEvent.RelatedToData[0];
+
+ }
+
+ ASSERT_EQ("person.1@example.com", RelatedTo);
+
+ // Get the second RELATED-TO.
+
+ RelatedTo.clear();
+
+ std::string RelatedToType;
+
+ if (TestEvent.RelatedToData.size() > 1){
+
+ RelatedTo = TestEvent.RelatedToData[1];
+
+ }
+
+ if (TestEvent.RelatedToData.size() > 1){
+
+ RelatedToType = TestEvent.RelatedToDataRelationType[1];
+
+ }
+
+ ASSERT_EQ("person.2@example.com", RelatedTo);
+ ASSERT_EQ("PARENT", RelatedToType);
+
+ // Get the third RELATED-TO.
+
+ RelatedTo.clear();
+
+ std::string RelatedToTokens;
+
+ if (TestEvent.RelatedToData.size() > 2){
+
+ RelatedTo = TestEvent.RelatedToData[2];
+
+ }
+
+ if (TestEvent.RelatedToData.size() > 2){
+
+ RelatedToTokens = TestEvent.RelatedToDataTokens[2];
+
+ }
+
+ ASSERT_EQ("person.3@example.com", RelatedTo);
+ ASSERT_EQ("SCHOOL=MEETING", RelatedToTokens);
+
}
\ No newline at end of file