+TEST(ContactLoad, CalendarURITests){
+
+ // Setup the sound files first.
+
+ ContactDataObject TestFile;
+
+ // Check that the vCard 4.0 file loads OK.
+
+ ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
+
+ std::map<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::iterator TestFileIntIter;
+
+ // Start with a general calendar address.
+
+ TestFileIter = TestFile.CalendarList.find(0);
+ ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
+ ASSERT_EQ("http://example.com", TestFileIter->second);
+
+ // Check the TYPE section.
+
+ TestFileIter = TestFile.CalendarListType.find(0);
+ ASSERT_EQ(TestFile.CalendarListType.end(), TestFileIter);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.CalendarListAltID.find(0);
+ ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
+ ASSERT_EQ("34", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.CalendarListPID.find(0);
+ ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
+ ASSERT_EQ("31", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.CalendarListMediatype.find(0);
+ ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
+ ASSERT_EQ("text/plain", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.CalendarListPref.find(0);
+ ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
+ ASSERT_EQ(32, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.CalendarListTokens.find(0);
+ ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
+ ASSERT_EQ("CALENDARS=FLYING", TestFileIter->second);
+
+ // Start with a home calendar address.
+
+ TestFileIter = TestFile.CalendarList.find(1);
+ ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
+ ASSERT_EQ("http://example.com/home", TestFileIter->second);
+
+ // Check the TYPE section.
+
+ TestFileIter = TestFile.CalendarListType.find(1);
+ ASSERT_NE(TestFile.CalendarListType.end(), TestFileIter);
+ ASSERT_EQ("home", TestFileIter->second);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.CalendarListAltID.find(1);
+ ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
+ ASSERT_EQ("44", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.CalendarListPID.find(1);
+ ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
+ ASSERT_EQ("41", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.CalendarListMediatype.find(1);
+ ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
+ ASSERT_EQ("text/dryplain", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.CalendarListPref.find(1);
+ ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
+ ASSERT_EQ(42, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.CalendarListTokens.find(1);
+ ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
+ ASSERT_EQ("CALENDARS=GROUNDED", TestFileIter->second);
+
+ // Start with a business calendar address.
+
+ TestFileIter = TestFile.CalendarList.find(2);
+ ASSERT_NE(TestFile.CalendarList.end(), TestFileIter);
+ ASSERT_EQ("http://example.com/business", TestFileIter->second);
+
+ // Check the TYPE section.
+
+ TestFileIter = TestFile.CalendarListType.find(2);
+ ASSERT_NE(TestFile.CalendarListType.end(), TestFileIter);
+ ASSERT_EQ("work", TestFileIter->second);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.CalendarListAltID.find(2);
+ ASSERT_NE(TestFile.CalendarListAltID.end(), TestFileIter);
+ ASSERT_EQ("54", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.CalendarListPID.find(2);
+ ASSERT_NE(TestFile.CalendarListPID.end(), TestFileIter);
+ ASSERT_EQ("51", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.CalendarListMediatype.find(2);
+ ASSERT_NE(TestFile.CalendarListMediatype.end(), TestFileIter);
+ ASSERT_EQ("text/stillwetink", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.CalendarListPref.find(2);
+ ASSERT_NE(TestFile.CalendarListPref.end(), TestFileIntIter);
+ ASSERT_EQ(52, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.CalendarListTokens.find(2);
+ ASSERT_NE(TestFile.CalendarListTokens.end(), TestFileIter);
+ ASSERT_EQ("CALENDARS=CANCELLED", TestFileIter->second);
+
+}
+