}
+TEST(ContactLoad, PhotoTests){
+
+ ContactDataObject TestFile;
+
+ // Check that the vCard 4.0 file loads OK.
+
+ ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
+
+ std::map<int,std::string>::iterator TestStrIter;
+ std::map<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::iterator TestFileIntIter;
+
+ // Start with the first photo.
+
+ TestStrIter = TestFile.PicturesList.find(0);
+ ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
+ ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==",
+ TestStrIter->second);
+
+ // Check that it has the correct encoding.
+
+ TestFileIter = TestFile.PicturesListPicEncType.find(0);
+ ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
+ ASSERT_EQ("base64", TestFileIter->second);
+
+ // Check that it has the correct image type.
+
+ TestFileIter = TestFile.PicturesListPictureType.find(0);
+ ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.PicturesListAltID.find(0);
+ ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
+ ASSERT_EQ("70", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.PicturesListPID.find(0);
+ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
+ ASSERT_EQ("71", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.PicturesListMediatype.find(0);
+ ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.PicturesListPref.find(0);
+ ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
+ ASSERT_EQ(72, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.PicturesListTokens.find(0);
+ ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
+ ASSERT_EQ("MEEP=MOO", TestFileIter->second);
+
+ // Start with the second photo.
+
+ TestStrIter = TestFile.PicturesList.find(1);
+ ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
+ ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC",
+ TestStrIter->second);
+
+ // Check that it has the correct encoding.
+
+ TestFileIter = TestFile.PicturesListPicEncType.find(1);
+ ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
+ ASSERT_EQ("base64", TestFileIter->second);
+
+ // Check that it has the correct image type.
+
+ TestFileIter = TestFile.PicturesListPictureType.find(1);
+ ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.PicturesListAltID.find(1);
+ ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
+ ASSERT_EQ("20", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.PicturesListPID.find(1);
+ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
+ ASSERT_EQ("21", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.PicturesListMediatype.find(1);
+ ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.PicturesListPref.find(1);
+ ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
+ ASSERT_EQ(22, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.PicturesListTokens.find(1);
+ ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
+ ASSERT_EQ("BEEP=BOOP", TestFileIter->second);
+
+ // Start with the second photo.
+
+ TestStrIter = TestFile.PicturesList.find(2);
+ ASSERT_NE(TestFile.PicturesList.end(), TestStrIter);
+ ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=",
+ TestStrIter->second);
+
+ // Check that it has the correct encoding.
+
+ TestFileIter = TestFile.PicturesListPicEncType.find(2);
+ ASSERT_NE(TestFile.PicturesListPicEncType.end(), TestFileIter);
+ ASSERT_EQ("base64", TestFileIter->second);
+
+ // Check that it has the correct image type.
+
+ TestFileIter = TestFile.PicturesListPictureType.find(2);
+ ASSERT_NE(TestFile.PicturesListPictureType.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the ALTID section.
+
+ TestFileIter = TestFile.PicturesListAltID.find(2);
+ ASSERT_NE(TestFile.PicturesListAltID.end(), TestFileIter);
+ ASSERT_EQ("90", TestFileIter->second);
+
+ // Check the PID section.
+
+ TestFileIter = TestFile.PicturesListPID.find(2);
+ ASSERT_NE(TestFile.PicturesListPID.end(), TestFileIter);
+ ASSERT_EQ("91", TestFileIter->second);
+
+ // Check the MEDIATYPE section.
+
+ TestFileIter = TestFile.PicturesListMediatype.find(2);
+ ASSERT_NE(TestFile.PicturesListMediatype.end(), TestFileIter);
+ ASSERT_EQ("image/png", TestFileIter->second);
+
+ // Check the PREF section.
+
+ TestFileIntIter = TestFile.PicturesListPref.find(2);
+ ASSERT_NE(TestFile.PicturesListPref.end(), TestFileIntIter);
+ ASSERT_EQ(92, TestFileIntIter->second);
+
+ // Check the extra tokens.
+
+ TestFileIter = TestFile.PicturesListTokens.find(2);
+ ASSERT_NE(TestFile.PicturesListTokens.end(), TestFileIter);
+ ASSERT_EQ("PHOTO=YUP", TestFileIter->second);
+
+}
+
// TODO: Add tests for the Contact Loading process.
\ No newline at end of file