X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Ftests%2Fxestiaab_contactload.h;h=f4be7fbefc7fb9cff2d2125d4494a55e441eac03;hp=39fe16f59c5db1a803b362d124b0bdd0198b1257;hb=fb85e5194a16222937abf13bcfd53a28e47675ee;hpb=12e81906f4a76d4773a0305e0722aed881148db7 diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index 39fe16f..f4be7fb 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -1215,4 +1215,125 @@ TEST(ContactLoad, LanguageTests){ } +TEST(ContactLoad, GeographicTests){ + + ContactDataObject TestFile; + + // Check that the vCard 4.0 file loads OK. + + ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf")); + + std::map::iterator TestFileIter; + std::map::iterator TestFileIntIter; + + // Start with the general Geoposition. + + TestFileIter = TestFile.GeneralGeographyList.find(0); + ASSERT_NE(TestFile.GeneralGeographyList.end(), TestFileIter); + ASSERT_EQ("geo:3.5,3.5", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.GeneralGeographyListAltID.find(0); + ASSERT_NE(TestFile.GeneralGeographyListAltID.end(), TestFileIter); + ASSERT_EQ("13", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.GeneralGeographyListPID.find(0); + ASSERT_NE(TestFile.GeneralGeographyListPID.end(), TestFileIter); + ASSERT_EQ("26", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.GeneralGeographyListMediatype.find(0); + ASSERT_NE(TestFile.GeneralGeographyListMediatype.end(), TestFileIter); + ASSERT_EQ("text/plain", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.GeneralGeographyListPref.find(0); + ASSERT_NE(TestFile.GeneralGeographyListPref.end(), TestFileIntIter); + ASSERT_EQ(39, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.GeneralGeographyListTokens.find(0); + ASSERT_NE(TestFile.GeneralGeographyListTokens.end(), TestFileIter); + ASSERT_EQ("POS=Yep", TestFileIter->second); + + // Start with the home Geoposition. + + TestFileIter = TestFile.HomeGeographyList.find(1); + ASSERT_NE(TestFile.HomeGeographyList.end(), TestFileIter); + ASSERT_EQ("geo:7.0,7.0", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.HomeGeographyListAltID.find(1); + ASSERT_NE(TestFile.HomeGeographyListAltID.end(), TestFileIter); + ASSERT_EQ("140", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.HomeGeographyListPID.find(1); + ASSERT_NE(TestFile.HomeGeographyListPID.end(), TestFileIter); + ASSERT_EQ("70", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.HomeGeographyListMediatype.find(1); + ASSERT_NE(TestFile.HomeGeographyListMediatype.end(), TestFileIter); + ASSERT_EQ("text/ratherplain", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.HomeGeographyListPref.find(1); + ASSERT_NE(TestFile.HomeGeographyListPref.end(), TestFileIntIter); + ASSERT_EQ(1, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.HomeGeographyListTokens.find(1); + ASSERT_NE(TestFile.HomeGeographyListTokens.end(), TestFileIter); + ASSERT_EQ("POS=Nope", TestFileIter->second); + + // Start with the business Geoposition. + + TestFileIter = TestFile.BusinessGeographyList.find(2); + ASSERT_NE(TestFile.BusinessGeographyList.end(), TestFileIter); + ASSERT_EQ("geo:14.0,14.0", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.BusinessGeographyListAltID.find(2); + ASSERT_NE(TestFile.BusinessGeographyListAltID.end(), TestFileIter); + ASSERT_EQ("75", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.BusinessGeographyListPID.find(2); + ASSERT_NE(TestFile.BusinessGeographyListPID.end(), TestFileIter); + ASSERT_EQ("32", TestFileIter->second); + + // Check the MEDIATYPE section. + + TestFileIter = TestFile.BusinessGeographyListMediatype.find(2); + ASSERT_NE(TestFile.BusinessGeographyListMediatype.end(), TestFileIter); + ASSERT_EQ("text/greenplain", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.BusinessGeographyListPref.find(2); + ASSERT_NE(TestFile.BusinessGeographyListPref.end(), TestFileIntIter); + ASSERT_EQ(4, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.BusinessGeographyListTokens.find(2); + ASSERT_NE(TestFile.BusinessGeographyListTokens.end(), TestFileIter); + ASSERT_EQ("POS=Money", TestFileIter->second); + +} + // TODO: Add tests for the Contact Loading process. \ No newline at end of file