X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=blobdiff_plain;f=source%2Ftests%2Fxestiaab_contactload.h;h=5746b9d7f4ff1ba1f1cad7fd6920d684dba8ce16;hp=ece30637e565ca024eca9de64ba2882a508a26ea;hb=825e100fbd7f2492240af1d8688356fc210aeaae;hpb=a23e50effb7909d2217c6364b31f258bb9c55ff2 diff --git a/source/tests/xestiaab_contactload.h b/source/tests/xestiaab_contactload.h index ece3063..5746b9d 100644 --- a/source/tests/xestiaab_contactload.h +++ b/source/tests/xestiaab_contactload.h @@ -1816,7 +1816,146 @@ TEST(ContactLoad, RoleTests){ TestFileIter = TestFile.BusinessRoleListTokens.find(2); ASSERT_NE(TestFile.BusinessRoleListTokens.end(), TestFileIter); - ASSERT_EQ("HERE=Nope", TestFileIter->second); + ASSERT_EQ("HERE=Nope", TestFileIter->second); + +} + +TEST(ContactLoad, OrganisationTests){ + + 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 organisation. + + TestFileIter = TestFile.GeneralOrganisationsList.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsList.end(), TestFileIter); + ASSERT_EQ("Ordinary Organisation", TestFileIter->second); + + // Check the SORT-AS section. + + TestFileIter = TestFile.GeneralOrganisationsListSortAs.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListSortAs.end(), TestFileIter); + ASSERT_EQ("Organisation, Ordinary", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.GeneralOrganisationsListAltID.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListAltID.end(), TestFileIter); + ASSERT_EQ("50", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.GeneralOrganisationsListPID.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListPID.end(), TestFileIter); + ASSERT_EQ("51", TestFileIter->second); + + // Check the LANGUAGE section. + + TestFileIter = TestFile.GeneralOrganisationsListLanguage.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListLanguage.end(), TestFileIter); + ASSERT_EQ("en", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.GeneralOrganisationsListPref.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListPref.end(), TestFileIntIter); + ASSERT_EQ(52, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.GeneralOrganisationsListTokens.find(0); + ASSERT_NE(TestFile.GeneralOrganisationsListTokens.end(), TestFileIter); + ASSERT_EQ("ASTERISK=None", TestFileIter->second); + + // Start with the home Organisation. + + TestFileIter = TestFile.HomeOrganisationsList.find(1); + ASSERT_NE(TestFile.HomeOrganisationsList.end(), TestFileIter); + ASSERT_EQ("Ordinary Lazy Person", TestFileIter->second); + + // Check the SORT-AS section. + + TestFileIter = TestFile.HomeOrganisationsListSortAs.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListSortAs.end(), TestFileIter); + ASSERT_EQ("Person, Ordinary Lazy", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.HomeOrganisationsListAltID.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListAltID.end(), TestFileIter); + ASSERT_EQ("60", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.HomeOrganisationsListPID.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListPID.end(), TestFileIter); + ASSERT_EQ("61", TestFileIter->second); + + // Check the LANGUAGE section. + + TestFileIter = TestFile.HomeOrganisationsListLanguage.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListLanguage.end(), TestFileIter); + ASSERT_EQ("en-GB", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.HomeOrganisationsListPref.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListPref.end(), TestFileIntIter); + ASSERT_EQ(62, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.HomeOrganisationsListTokens.find(1); + ASSERT_NE(TestFile.HomeOrganisationsListTokens.end(), TestFileIter); + ASSERT_EQ("SOMEWHERE=There", TestFileIter->second); + + // Start with the business Organisation. + + TestFileIter = TestFile.BusinessOrganisationsList.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsList.end(), TestFileIter); + ASSERT_EQ("Company Owner", TestFileIter->second); + + // Check the SORT-AS section. + + TestFileIter = TestFile.BusinessOrganisationsListSortAs.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListSortAs.end(), TestFileIter); + ASSERT_EQ("Owner, Company", TestFileIter->second); + + // Check the ALTID section. + + TestFileIter = TestFile.BusinessOrganisationsListAltID.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListAltID.end(), TestFileIter); + ASSERT_EQ("70", TestFileIter->second); + + // Check the PID section. + + TestFileIter = TestFile.BusinessOrganisationsListPID.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListPID.end(), TestFileIter); + ASSERT_EQ("71", TestFileIter->second); + + // Check the LANGUAGE section. + + TestFileIter = TestFile.BusinessOrganisationsListLanguage.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListLanguage.end(), TestFileIter); + ASSERT_EQ("en-AU", TestFileIter->second); + + // Check the PREF section. + + TestFileIntIter = TestFile.BusinessOrganisationsListPref.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListPref.end(), TestFileIntIter); + ASSERT_EQ(72, TestFileIntIter->second); + + // Check the extra tokens. + + TestFileIter = TestFile.BusinessOrganisationsListTokens.find(2); + ASSERT_NE(TestFile.BusinessOrganisationsListTokens.end(), TestFileIter); + ASSERT_EQ("HERE=Nope", TestFileIter->second); }