// xestiaab_contactload.h - Xestia Address Book Contact Load Unit Tests.
//
// (c) 2012-2015 Xestia Software Development.
//
// This file is part of Xestia Address Book.
//
// Xestia Address Book is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by the
// Free Software Foundation, version 3 of the license.
//
// Xestia Address Book is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with Xestia Address Book. If not, see
#include
#include "../contacteditor/cdo/ContactDataObject.h"
TEST(ContactLoad, ContactLoadTests){
ContactDataObject TestFile;
// Check that the file given is not missing.
ASSERT_EQ(CONTACTLOAD_FILEMISSING, TestFile.LoadFile("MissingFile.vcf"));
// Check that the file given does not have an error when attempting to
// open it.
ASSERT_EQ(CONTACTLOAD_FILEERROR, TestFile.LoadFile("InvalidPermissions.vcf"));
// Check that the file is a valid vCard 4.0 file.
ASSERT_EQ(CONTACTLOAD_FILEINVALIDFORMAT, TestFile.LoadFile("LoadCheck-Load1-v3.vcf"));
// Check that the vCard 4.0 file meets the base specification.
ASSERT_EQ(CONTACTLOAD_FILEBASESPECFAIL, TestFile.LoadFile("LoadCheck-Load3.vcf"));
// Check that the vCard 4.0 file loads OK.
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
// Check that the kind status has been set. (KIND).
ASSERT_NE(CONTACTKIND_NONE, TestFile.ContactKind);
ASSERT_EQ(CONTACTKIND_INDIVIDUAL, TestFile.ContactKind);
// Check that the groups have been read (MEMBER).
std::map::iterator TestFileIter;
std::map::iterator TestFileIntIter;
TestFileIter = TestFile.GroupsList.find(0);
ASSERT_NE(TestFile.GroupsList.end(), TestFileIter);
ASSERT_EQ("7a2af44d-6431-4797-a55f-d86d56304fda", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.GroupsListAltID.find(0);
ASSERT_NE(TestFile.GroupsListAltID.end(), TestFileIter);
ASSERT_EQ("35", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.GroupsListPID.find(0);
ASSERT_NE(TestFile.GroupsListPID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.GroupsListPref.find(0);
ASSERT_NE(TestFile.GroupsListPref.end(), TestFileIntIter);
ASSERT_EQ(45, TestFileIntIter->second);
// Check the MEDIATYPE parameter.
TestFileIter = TestFile.GroupsListMediaType.find(0);
ASSERT_NE(TestFile.GroupsListMediaType.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.GroupsListTokens.find(0);
ASSERT_NE(TestFile.GroupsListTokens.end(), TestFileIter);
ASSERT_EQ("EXAMPLE=Meep", TestFileIter->second);
// Check that the formatted name has been read (FN).
TestFileIter = TestFile.FullNamesList.find(0);
ASSERT_NE(TestFile.FullNamesList.end(), TestFileIter);
ASSERT_EQ("Test Contact", TestFileIter->second);
// Check the TYPE parameter.
TestFileIter = TestFile.FullNamesListType.find(0);
ASSERT_NE(TestFile.FullNamesListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.FullNamesListLanguage.find(0);
ASSERT_NE(TestFile.FullNamesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.FullNamesListAltID.find(0);
ASSERT_NE(TestFile.FullNamesListAltID.end(), TestFileIter);
ASSERT_EQ("500", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.FullNamesListPID.find(0);
ASSERT_NE(TestFile.FullNamesListPID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.FullNamesListPref.find(0);
ASSERT_NE(TestFile.FullNamesListPref.end(), TestFileIntIter);
ASSERT_EQ(45, TestFileIntIter->second);
// Check for the extra tokens parameter.
TestFileIter = TestFile.FullNamesListTokens.find(0);
ASSERT_NE(TestFile.FullNamesListTokens.end(), TestFileIter);
ASSERT_EQ("EXAMPLE=Baaa", TestFileIter->second);
// Check that the name has been read (N).
ASSERT_EQ("Contact", TestFile.NameSurname);
ASSERT_EQ("Test", TestFile.NameForename);
ASSERT_EQ("Example", TestFile.NameOtherNames);
ASSERT_EQ("Robot", TestFile.NameTitle);
ASSERT_EQ("LOONY", TestFile.NameSuffix);
// Check the ALTID parameter.
ASSERT_EQ("3", TestFile.NameAltID);
// Check the LANGUAGE parameter.
ASSERT_EQ("kw", TestFile.NameLanguage);
// Check the SORT-AS parameter.
ASSERT_EQ("Contact,Test", TestFile.NameDisplayAs);
// Check the extra tokens parameter.
ASSERT_EQ("TEST=Yes", TestFile.NameTokens);
}
TEST(ContactLoad, UIDTest){
ContactDataObject TestFile;
// Check that the vCard 4.0 file loads OK.
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
ASSERT_EQ("903588-9082374-989120310-AAFECDBCDF", TestFile.UIDToken);
}
TEST(ContactLoad, ClientPIDMapTests){
ContactDataObject TestFile;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
std::map::iterator TestFileIter;
// Test the first Client PID Map.
TestFileIter = TestFile.ClientPIDList.find(0);
ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
ASSERT_EQ("1;urn;uuid:aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", TestFileIter->second);
TestFileIter = TestFile.ClientPIDListTokens.find(0);
ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
// Test the second Client PID Map.
TestFileIter = TestFile.ClientPIDList.find(1);
ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
ASSERT_EQ("2;urn;uuid:ccccccccc-cccc-cccc-cccc-cccccccccccc", TestFileIter->second);
TestFileIter = TestFile.ClientPIDListTokens.find(1);
ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
// Test the third Client PID Map.
TestFileIter = TestFile.ClientPIDListTokens.find(2);
ASSERT_NE(TestFile.ClientPIDListTokens.end(), TestFileIter);
ASSERT_EQ("MEEP=MOO;WOOP=WOO", TestFileIter->second);
TestFileIter = TestFile.ClientPIDList.find(2);
ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
ASSERT_EQ("3;urn;uuid:bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", TestFileIter->second);
}
TEST(ContactLoad, RevisionTests){
ContactDataObject TestFile;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
ASSERT_EQ("20151227T033000Z", TestFile.Revision);
ASSERT_EQ("TEST=YES;DATA=NO;MORE=MAYBE", TestFile.RevisionTokens);
}
TEST(ContactLoad, SourceTests){
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 a general source address.
TestFileIter = TestFile.SourceList.find(0);
ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
ASSERT_EQ("http://example.com/source/sourcea.vcf", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SourceListType.find(0);
ASSERT_EQ(TestFile.SourceListType.end(), TestFileIter);
// Check the ALTID section.
TestFileIter = TestFile.SourceListAltID.find(0);
ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
ASSERT_EQ("74", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SourceListPID.find(0);
ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SourceListMediatype.find(0);
ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SourceListPref.find(0);
ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SourceListTokens.find(0);
ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=FEED", TestFileIter->second);
// Start with the home source address.
TestFileIter = TestFile.SourceList.find(1);
ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
ASSERT_EQ("http://example.com/source/sourceb.vcf", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SourceListType.find(1);
ASSERT_NE(TestFile.SourceListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.SourceListAltID.find(1);
ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
ASSERT_EQ("84", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SourceListPID.find(1);
ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
ASSERT_EQ("81", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SourceListMediatype.find(1);
ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plainpaper", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SourceListPref.find(1);
ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
ASSERT_EQ(82, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SourceListTokens.find(1);
ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=ONLINE", TestFileIter->second);
// Start with the home source address.
TestFileIter = TestFile.SourceList.find(2);
ASSERT_NE(TestFile.SourceList.end(), TestFileIter);
ASSERT_EQ("http://example.com/source/sourcec.vcf", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SourceListType.find(2);
ASSERT_NE(TestFile.SourceListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.SourceListAltID.find(2);
ASSERT_NE(TestFile.SourceListAltID.end(), TestFileIter);
ASSERT_EQ("94", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SourceListPID.find(2);
ASSERT_NE(TestFile.SourceListPID.end(), TestFileIter);
ASSERT_EQ("91", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SourceListMediatype.find(2);
ASSERT_NE(TestFile.SourceListMediatype.end(), TestFileIter);
ASSERT_EQ("text/sandpaper", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SourceListPref.find(2);
ASSERT_NE(TestFile.SourceListPref.end(), TestFileIntIter);
ASSERT_EQ(92, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SourceListTokens.find(2);
ASSERT_NE(TestFile.SourceListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=OFFLINE", TestFileIter->second);
}
TEST(ContactLoad, XMLTest){
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 first XML property.
// Start with a general source address.
TestFileIter = TestFile.XMLList.find(0);
ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
ASSERT_EQ("Example Page 1", TestFileIter->second);
TestFileIter = TestFile.XMLList.find(1);
ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
ASSERT_EQ("Example Page 2", TestFileIter->second);
TestFileIter = TestFile.XMLList.find(2);
ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
ASSERT_EQ("Example Page 3", TestFileIter->second);
}
TEST(ContactLoad, NicknameTests){
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;
// Check that the nickname has been read (NICKNAME). General.
TestFileIter = TestFile.GeneralNicknamesList.find(0);
ASSERT_NE(TestFile.GeneralNicknamesList.end(), TestFileIter);
ASSERT_EQ("Tester", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.GeneralNicknamesListAltID.find(0);
ASSERT_NE(TestFile.GeneralNicknamesListAltID.end(), TestFileIter);
ASSERT_EQ("35", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.GeneralNicknamesListPID.find(0);
ASSERT_NE(TestFile.GeneralNicknamesListPID.end(), TestFileIter);
ASSERT_EQ("50", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.GeneralNicknamesListPref.find(0);
ASSERT_NE(TestFile.GeneralNicknamesListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.GeneralNicknamesListLanguage.find(0);
ASSERT_NE(TestFile.GeneralNicknamesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.GeneralNicknamesListTokens.find(0);
ASSERT_NE(TestFile.GeneralNicknamesListTokens.end(), TestFileIter);
ASSERT_EQ("YAY=Nope;Beep=Boop", TestFileIter->second);
// Repeat for the home type.
TestFileIter = TestFile.HomeNicknamesList.find(1);
ASSERT_NE(TestFile.HomeNicknamesList.end(), TestFileIter);
ASSERT_EQ("Testy", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.HomeNicknamesListAltID.find(1);
ASSERT_NE(TestFile.HomeNicknamesListAltID.end(), TestFileIter);
ASSERT_EQ("17", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.HomeNicknamesListPID.find(1);
ASSERT_NE(TestFile.HomeNicknamesListPID.end(), TestFileIter);
ASSERT_EQ("39", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.HomeNicknamesListPref.find(1);
ASSERT_NE(TestFile.HomeNicknamesListPref.end(), TestFileIntIter);
ASSERT_EQ(78, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.HomeNicknamesListLanguage.find(1);
ASSERT_NE(TestFile.HomeNicknamesListLanguage.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.HomeNicknamesListTokens.find(1);
ASSERT_NE(TestFile.HomeNicknamesListTokens.end(), TestFileIter);
ASSERT_EQ("YAY=Yep;Beep=Boop", TestFileIter->second);
// Repeat for the work type.
TestFileIter = TestFile.BusinessNicknamesList.find(2);
ASSERT_NE(TestFile.BusinessNicknamesList.end(), TestFileIter);
ASSERT_EQ("The Testing One", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.BusinessNicknamesListAltID.find(2);
ASSERT_NE(TestFile.BusinessNicknamesListAltID.end(), TestFileIter);
ASSERT_EQ("99", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.BusinessNicknamesListPID.find(2);
ASSERT_NE(TestFile.BusinessNicknamesListPID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.BusinessNicknamesListPref.find(2);
ASSERT_NE(TestFile.BusinessNicknamesListPref.end(), TestFileIntIter);
ASSERT_EQ(1, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.BusinessNicknamesListLanguage.find(2);
ASSERT_NE(TestFile.BusinessNicknamesListLanguage.end(), TestFileIter);
ASSERT_EQ("en-GB", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.BusinessNicknamesListTokens.find(2);
ASSERT_NE(TestFile.BusinessNicknamesListTokens.end(), TestFileIter);
ASSERT_EQ("YAY=Maybe;Boop=Boing", TestFileIter->second);
}
TEST(ContactLoad, GenderTests){
// Check that the gender has been read.
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;
ASSERT_NE("", TestFile.Gender);
ASSERT_EQ("F", TestFile.Gender);
ASSERT_EQ("Example Text", TestFile.GenderDetails);
ASSERT_EQ("BEEP=Boop", TestFile.GenderTokens);
}
TEST(ContactLoad, BirthdayTests){
// Check that the birthday has been read.
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;
ASSERT_NE("", TestFile.Birthday);
ASSERT_EQ("20040101", TestFile.Birthday);
// Check the ALTID parameter.
ASSERT_EQ("35", TestFile.BirthdayAltID);
// Check the CALSCALE parameter.
ASSERT_EQ("georgian", TestFile.BirthdayCalScale);
// Check the extra tokens parameter.
ASSERT_EQ("HAPPY=Days", TestFile.BirthdayTokens);
// Check the VALUE parameter. (Note have to use a different file
// due to the *1 rule in RFC6350.
ContactDataObject TestFileValue;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4-BDayValue.vcf"));
ASSERT_EQ("Circa 2000s", TestFile.Birthday);
}
TEST(ContactLoad, AnniversaryTests){
// Check that the anniversary has been read.
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;
ASSERT_NE("", TestFile.Anniversary);
ASSERT_EQ("20200516", TestFile.Anniversary);
// Check the ALTID parameter.
ASSERT_EQ("70", TestFile.AnniversaryAltID);
// Check the CALSCALE parameter.
ASSERT_EQ("georgian", TestFile.AnniversaryCalScale);
// Check the extra tokens parameter.
ASSERT_EQ("WONDERFUL=Day", TestFile.AnniversaryTokens);
// Check the VALUE parameter. (Note have to use a different file
// due to the *1 rule in RFC6350.
ContactDataObject TestFileValue;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4-BDayValue.vcf"));
ASSERT_EQ("Circa 2020s", TestFile.Anniversary);
}
TEST(ContactLoad, TimeZoneTests){
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;
// Check that the timezone has been read (TZ). General.
TestFileIter = TestFile.GeneralTZList.find(0);
ASSERT_NE(TestFile.GeneralTZList.end(), TestFileIter);
ASSERT_EQ("Europe/Truro", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.GeneralTZListAltID.find(0);
ASSERT_NE(TestFile.GeneralTZListAltID.end(), TestFileIter);
ASSERT_EQ("35", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.GeneralTZListPID.find(0);
ASSERT_NE(TestFile.GeneralTZListPID.end(), TestFileIter);
ASSERT_EQ("60", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.GeneralTZListPref.find(0);
ASSERT_NE(TestFile.GeneralTZListPref.end(), TestFileIntIter);
ASSERT_EQ(20, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.GeneralTZListMediatype.find(0);
ASSERT_NE(TestFile.GeneralTZListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.GeneralTZListTokens.find(0);
ASSERT_NE(TestFile.GeneralTZListTokens.end(), TestFileIter);
ASSERT_EQ("WHATS=This;A=Potato", TestFileIter->second);
// Check that the timezone has been read (TZ). Home.
TestFileIter = TestFile.HomeTZList.find(1);
ASSERT_NE(TestFile.HomeTZList.end(), TestFileIter);
ASSERT_EQ("Europe/Penzance", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.HomeTZListAltID.find(1);
ASSERT_NE(TestFile.HomeTZListAltID.end(), TestFileIter);
ASSERT_EQ("15", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.HomeTZListPID.find(1);
ASSERT_NE(TestFile.HomeTZListPID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.HomeTZListPref.find(1);
ASSERT_NE(TestFile.HomeTZListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.HomeTZListMediatype.find(1);
ASSERT_NE(TestFile.HomeTZListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.HomeTZListTokens.find(1);
ASSERT_NE(TestFile.HomeTZListTokens.end(), TestFileIter);
ASSERT_EQ("MAYBE=not", TestFileIter->second);
// Check that the timezone has been read (TZ). Business.
TestFileIter = TestFile.BusinessTZList.find(2);
ASSERT_NE(TestFile.BusinessTZList.end(), TestFileIter);
ASSERT_EQ("Europe/St Austell", TestFileIter->second);
// Check the ALTID parameter.
TestFileIter = TestFile.BusinessTZListAltID.find(2);
ASSERT_NE(TestFile.BusinessTZListAltID.end(), TestFileIter);
ASSERT_EQ("45", TestFileIter->second);
// Check the PID parameter.
TestFileIter = TestFile.BusinessTZListPID.find(2);
ASSERT_NE(TestFile.BusinessTZListPID.end(), TestFileIter);
ASSERT_EQ("70", TestFileIter->second);
// Check the PREF parameter.
TestFileIntIter = TestFile.BusinessTZListPref.find(2);
ASSERT_NE(TestFile.BusinessTZListPref.end(), TestFileIntIter);
ASSERT_EQ(80, TestFileIntIter->second);
// Check the LANGUAGE parameter.
TestFileIter = TestFile.BusinessTZListMediatype.find(2);
ASSERT_NE(TestFile.BusinessTZListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the extra tokens parameter.
TestFileIter = TestFile.BusinessTZListTokens.find(2);
ASSERT_NE(TestFile.BusinessTZListTokens.end(), TestFileIter);
ASSERT_EQ("MAYBE=yes", TestFileIter->second);
}
TEST(ContactLoad, AddressTests){
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 address.
// Check the address street section.
TestFileIter = TestFile.GeneralAddressList.find(0);
ASSERT_NE(TestFile.GeneralAddressList.end(), TestFileIter);
ASSERT_EQ("1 Lovely Lane", TestFileIter->second);
// Check the address town section.
TestFileIter = TestFile.GeneralAddressListTown.find(0);
ASSERT_NE(TestFile.GeneralAddressListTown.end(), TestFileIter);
ASSERT_EQ("Rodney", TestFileIter->second);
// Check the address county section.
TestFileIter = TestFile.GeneralAddressListCounty.find(0);
ASSERT_NE(TestFile.GeneralAddressListCounty.end(), TestFileIter);
ASSERT_EQ("Cornwall", TestFileIter->second);
// Check the address post code section.
TestFileIter = TestFile.GeneralAddressListPostCode.find(0);
ASSERT_NE(TestFile.GeneralAddressListPostCode.end(), TestFileIter);
ASSERT_EQ("PL99 1AA", TestFileIter->second);
// Check the address country section.
TestFileIter = TestFile.GeneralAddressListCountry.find(0);
ASSERT_NE(TestFile.GeneralAddressListCountry.end(), TestFileIter);
ASSERT_EQ("United Kingdom", TestFileIter->second);
// Check the LABEL section.
TestFileIter = TestFile.GeneralAddressListLabel.find(0);
ASSERT_NE(TestFile.GeneralAddressListLabel.end(), TestFileIter);
ASSERT_EQ("\"1 Lovely Lane\nRodney\nCornwall\nPL99 1AA\nCornwall\nUnited Kingdom\"", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.GeneralAddressListLang.find(0);
ASSERT_NE(TestFile.GeneralAddressListLang.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralAddressListAltID.find(0);
ASSERT_NE(TestFile.GeneralAddressListAltID.end(), TestFileIter);
ASSERT_EQ("15", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralAddressListPID.find(0);
ASSERT_NE(TestFile.GeneralAddressListPID.end(), TestFileIter);
ASSERT_EQ("81", TestFileIter->second);
// Check the GEO section.
TestFileIter = TestFile.GeneralAddressListGeo.find(0);
ASSERT_NE(TestFile.GeneralAddressListGeo.end(), TestFileIter);
ASSERT_EQ("\"geo:1.0, 1.0\"", TestFileIter->second);
// Check the TZ section.
TestFileIter = TestFile.GeneralAddressListTimezone.find(0);
ASSERT_NE(TestFile.GeneralAddressListTimezone.end(), TestFileIter);
ASSERT_EQ("Europe/Truro", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.GeneralAddressListMediatype.find(0);
ASSERT_NE(TestFile.GeneralAddressListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralAddressListPref.find(0);
ASSERT_NE(TestFile.GeneralAddressListPref.end(), TestFileIntIter);
ASSERT_EQ(98, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralAddressListTokens.find(0);
ASSERT_NE(TestFile.GeneralAddressListTokens.end(), TestFileIter);
ASSERT_EQ("MAKES=Moo;ANIMAL=Cow", TestFileIter->second);
// Process the home address
// Check the address street section.
TestFileIter = TestFile.HomeAddressList.find(1);
ASSERT_NE(TestFile.HomeAddressList.end(), TestFileIter);
ASSERT_EQ("3 Working Plaice", TestFileIter->second);
// Check the address town section.
TestFileIter = TestFile.HomeAddressListTown.find(1);
ASSERT_NE(TestFile.HomeAddressListTown.end(), TestFileIter);
ASSERT_EQ("Roger", TestFileIter->second);
// Check the address county section.
TestFileIter = TestFile.HomeAddressListCounty.find(1);
ASSERT_NE(TestFile.HomeAddressListCounty.end(), TestFileIter);
ASSERT_EQ("Cornwall", TestFileIter->second);
// Check the address post code section.
TestFileIter = TestFile.HomeAddressListPostCode.find(1);
ASSERT_NE(TestFile.HomeAddressListPostCode.end(), TestFileIter);
ASSERT_EQ("PL75 4ZZ", TestFileIter->second);
// Check the address country section.
TestFileIter = TestFile.HomeAddressListCountry.find(1);
ASSERT_NE(TestFile.HomeAddressListCountry.end(), TestFileIter);
ASSERT_EQ("United Kingdom", TestFileIter->second);
// Check the LABEL section.
TestFileIter = TestFile.HomeAddressListLabel.find(1);
ASSERT_NE(TestFile.HomeAddressListLabel.end(), TestFileIter);
ASSERT_EQ("\"3 Working Plaice\nRoger\nCornwall\nPL75 4ZZ\nCornwall\nUnited Kingdom\"", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.HomeAddressListLang.find(1);
ASSERT_NE(TestFile.HomeAddressListLang.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeAddressListAltID.find(1);
ASSERT_NE(TestFile.HomeAddressListAltID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeAddressListPID.find(1);
ASSERT_NE(TestFile.HomeAddressListPID.end(), TestFileIter);
ASSERT_EQ("13", TestFileIter->second);
// Check the GEO section.
TestFileIter = TestFile.HomeAddressListGeo.find(1);
ASSERT_NE(TestFile.HomeAddressListGeo.end(), TestFileIter);
ASSERT_EQ("\"geo:4.0, 4.0\"", TestFileIter->second);
// Check the TZ section.
TestFileIter = TestFile.HomeAddressListTimezone.find(1);
ASSERT_NE(TestFile.HomeAddressListTimezone.end(), TestFileIter);
ASSERT_EQ("Europe/St Ives", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.HomeAddressListMediatype.find(1);
ASSERT_NE(TestFile.HomeAddressListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeAddressListPref.find(1);
ASSERT_NE(TestFile.HomeAddressListPref.end(), TestFileIntIter);
ASSERT_EQ(10, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeAddressListTokens.find(1);
ASSERT_NE(TestFile.HomeAddressListTokens.end(), TestFileIter);
ASSERT_EQ("TOAST=Butter", TestFileIter->second);
// Process the business address.
// Check the address street section.
TestFileIter = TestFile.BusinessAddressList.find(2);
ASSERT_NE(TestFile.BusinessAddressList.end(), TestFileIter);
ASSERT_EQ("7 Flyby Drive", TestFileIter->second);
// Check the address town section.
TestFileIter = TestFile.BusinessAddressListTown.find(2);
ASSERT_NE(TestFile.BusinessAddressListTown.end(), TestFileIter);
ASSERT_EQ("Elaine", TestFileIter->second);
// Check the address county section.
TestFileIter = TestFile.BusinessAddressListCounty.find(2);
ASSERT_NE(TestFile.BusinessAddressListCounty.end(), TestFileIter);
ASSERT_EQ("Cornwall", TestFileIter->second);
// Check the address post code section.
TestFileIter = TestFile.BusinessAddressListPostCode.find(2);
ASSERT_NE(TestFile.BusinessAddressListPostCode.end(), TestFileIter);
ASSERT_EQ("PL84 9YE", TestFileIter->second);
// Check the address country section.
TestFileIter = TestFile.BusinessAddressListCountry.find(2);
ASSERT_NE(TestFile.BusinessAddressListCountry.end(), TestFileIter);
ASSERT_EQ("United Kingdom", TestFileIter->second);
// Check the LABEL section.
TestFileIter = TestFile.BusinessAddressListLabel.find(2);
ASSERT_NE(TestFile.BusinessAddressListLabel.end(), TestFileIter);
ASSERT_EQ("\"7 Flyby Drive\nElaine\nCornwall\nPL84 9YE\nCornwall\nUnited Kingdom\"", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.BusinessAddressListLang.find(2);
ASSERT_NE(TestFile.BusinessAddressListLang.end(), TestFileIter);
ASSERT_EQ("en-GB", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessAddressListAltID.find(2);
ASSERT_NE(TestFile.BusinessAddressListAltID.end(), TestFileIter);
ASSERT_EQ("45", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessAddressListPID.find(2);
ASSERT_NE(TestFile.BusinessAddressListPID.end(), TestFileIter);
ASSERT_EQ("28", TestFileIter->second);
// Check the GEO section.
TestFileIter = TestFile.BusinessAddressListGeo.find(2);
ASSERT_NE(TestFile.BusinessAddressListGeo.end(), TestFileIter);
ASSERT_EQ("\"geo:7.0, 7.0\"", TestFileIter->second);
// Check the TZ section.
TestFileIter = TestFile.BusinessAddressListTimezone.find(2);
ASSERT_NE(TestFile.BusinessAddressListTimezone.end(), TestFileIter);
ASSERT_EQ("Europe/Newquay", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.BusinessAddressListMediatype.find(2);
ASSERT_NE(TestFile.BusinessAddressListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessAddressListPref.find(2);
ASSERT_NE(TestFile.BusinessAddressListPref.end(), TestFileIntIter);
ASSERT_EQ(10, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessAddressListTokens.find(2);
ASSERT_NE(TestFile.BusinessAddressListTokens.end(), TestFileIter);
ASSERT_EQ("JAM=Red", TestFileIter->second);
}
TEST(ContactLoad, EmailTests){
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 email.
TestFileIter = TestFile.GeneralEmailList.find(0);
ASSERT_NE(TestFile.GeneralEmailList.end(), TestFileIter);
ASSERT_EQ("moo@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralEmailListAltID.find(0);
ASSERT_NE(TestFile.GeneralEmailListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralEmailListPID.find(0);
ASSERT_NE(TestFile.GeneralEmailListPID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralEmailListPref.find(0);
ASSERT_NE(TestFile.GeneralEmailListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralEmailListTokens.find(0);
ASSERT_NE(TestFile.GeneralEmailListTokens.end(), TestFileIter);
ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
// Start with the home email.
TestFileIter = TestFile.HomeEmailList.find(1);
ASSERT_NE(TestFile.HomeEmailList.end(), TestFileIter);
ASSERT_EQ("moo.home@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeEmailListAltID.find(1);
ASSERT_NE(TestFile.HomeEmailListAltID.end(), TestFileIter);
ASSERT_EQ("5", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeEmailListPID.find(1);
ASSERT_NE(TestFile.HomeEmailListPID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeEmailListPref.find(1);
ASSERT_NE(TestFile.HomeEmailListPref.end(), TestFileIntIter);
ASSERT_EQ(20, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeEmailListTokens.find(1);
ASSERT_NE(TestFile.HomeEmailListTokens.end(), TestFileIter);
ASSERT_EQ("PEACE=quiet", TestFileIter->second);
// Start with the business email.
TestFileIter = TestFile.BusinessEmailList.find(2);
ASSERT_NE(TestFile.BusinessEmailList.end(), TestFileIter);
ASSERT_EQ("moo.business@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessEmailListAltID.find(2);
ASSERT_NE(TestFile.BusinessEmailListAltID.end(), TestFileIter);
ASSERT_EQ("1", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessEmailListPID.find(2);
ASSERT_NE(TestFile.BusinessEmailListPID.end(), TestFileIter);
ASSERT_EQ("2", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessEmailListPref.find(2);
ASSERT_NE(TestFile.BusinessEmailListPref.end(), TestFileIntIter);
ASSERT_EQ(3, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessEmailListTokens.find(2);
ASSERT_NE(TestFile.BusinessEmailListTokens.end(), TestFileIter);
ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
}
TEST(ContactLoad, IMTests){
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 IM.
TestFileIter = TestFile.GeneralIMList.find(0);
ASSERT_NE(TestFile.GeneralIMList.end(), TestFileIter);
ASSERT_EQ("moo@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralIMListAltID.find(0);
ASSERT_NE(TestFile.GeneralIMListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralIMListPID.find(0);
ASSERT_NE(TestFile.GeneralIMListPID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.GeneralIMListMediatype.find(0);
ASSERT_NE(TestFile.GeneralIMListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralIMListPref.find(0);
ASSERT_NE(TestFile.GeneralIMListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralIMListTokens.find(0);
ASSERT_NE(TestFile.GeneralIMListTokens.end(), TestFileIter);
ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
// Start with the home IM.
TestFileIter = TestFile.HomeIMList.find(1);
ASSERT_NE(TestFile.HomeIMList.end(), TestFileIter);
ASSERT_EQ("moo.home@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeIMListAltID.find(1);
ASSERT_NE(TestFile.HomeIMListAltID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeIMListPID.find(1);
ASSERT_NE(TestFile.HomeIMListPID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.HomeIMListMediatype.find(1);
ASSERT_NE(TestFile.HomeIMListMediatype.end(), TestFileIter);
ASSERT_EQ("text/reallyplain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeIMListPref.find(1);
ASSERT_NE(TestFile.HomeIMListPref.end(), TestFileIntIter);
ASSERT_EQ(80, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeIMListTokens.find(1);
ASSERT_NE(TestFile.HomeIMListTokens.end(), TestFileIter);
ASSERT_EQ("PEACE=quiet", TestFileIter->second);
// Start with the business IM.
TestFileIter = TestFile.BusinessIMList.find(2);
ASSERT_NE(TestFile.BusinessIMList.end(), TestFileIter);
ASSERT_EQ("moo.business@example.com", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessIMListAltID.find(2);
ASSERT_NE(TestFile.BusinessIMListAltID.end(), TestFileIter);
ASSERT_EQ("98", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessIMListPID.find(2);
ASSERT_NE(TestFile.BusinessIMListPID.end(), TestFileIter);
ASSERT_EQ("99", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.BusinessIMListMediatype.find(2);
ASSERT_NE(TestFile.BusinessIMListMediatype.end(), TestFileIter);
ASSERT_EQ("text/superplain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessIMListPref.find(2);
ASSERT_NE(TestFile.BusinessIMListPref.end(), TestFileIntIter);
ASSERT_EQ(50, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessIMListTokens.find(2);
ASSERT_NE(TestFile.BusinessIMListTokens.end(), TestFileIter);
ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
}
TEST(ContactLoad, TelephoneTests){
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 Telephone.
TestFileIter = TestFile.GeneralTelephoneList.find(0);
ASSERT_NE(TestFile.GeneralTelephoneList.end(), TestFileIter);
ASSERT_EQ("00000000", TestFileIter->second);
// Check the data type section.
TestFileIter = TestFile.GeneralTelephoneListDataType.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListDataType.end(), TestFileIter);
ASSERT_EQ("tel", TestFileIter->second);
// Check the type section.
TestFileIter = TestFile.GeneralTelephoneListTypeInfo.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListTypeInfo.end(), TestFileIter);
ASSERT_EQ("fax,cell", TestFileIter->second.ToStdString());
// Check the ALTID section.
TestFileIter = TestFile.GeneralTelephoneListAltID.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralTelephoneListPID.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListPID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralTelephoneListPref.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralTelephoneListTokens.find(0);
ASSERT_NE(TestFile.GeneralTelephoneListTokens.end(), TestFileIter);
ASSERT_EQ("WONDERFUL=Colour", TestFileIter->second);
// Start with the home Telephone.
TestFileIter = TestFile.HomeTelephoneList.find(1);
ASSERT_NE(TestFile.HomeTelephoneList.end(), TestFileIter);
ASSERT_EQ("00001111", TestFileIter->second);
// Check the data type section.
TestFileIter = TestFile.HomeTelephoneListDataType.find(1);
ASSERT_NE(TestFile.HomeTelephoneListDataType.end(), TestFileIter);
ASSERT_EQ("tel", TestFileIter->second);
// Check the type section.
TestFileIter = TestFile.HomeTelephoneListTypeInfo.find(1);
ASSERT_NE(TestFile.HomeTelephoneListTypeInfo.end(), TestFileIter);
ASSERT_EQ("fax", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeTelephoneListAltID.find(1);
ASSERT_NE(TestFile.HomeTelephoneListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeTelephoneListPID.find(1);
ASSERT_NE(TestFile.HomeTelephoneListPID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeTelephoneListPref.find(1);
ASSERT_NE(TestFile.HomeTelephoneListPref.end(), TestFileIntIter);
ASSERT_EQ(40, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeTelephoneListTokens.find(1);
ASSERT_NE(TestFile.HomeTelephoneListTokens.end(), TestFileIter);
ASSERT_EQ("BUSINESS=Money", TestFileIter->second);
// Start with the business Telephone.
TestFileIter = TestFile.BusinessTelephoneList.find(2);
ASSERT_NE(TestFile.BusinessTelephoneList.end(), TestFileIter);
ASSERT_EQ("22221111", TestFileIter->second);
// Check the data type section.
TestFileIter = TestFile.BusinessTelephoneListDataType.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListDataType.end(), TestFileIter);
ASSERT_EQ("tel", TestFileIter->second);
// Check the type section.
TestFileIter = TestFile.BusinessTelephoneListTypeInfo.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListTypeInfo.end(), TestFileIter);
ASSERT_EQ("voice", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessTelephoneListAltID.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListAltID.end(), TestFileIter);
ASSERT_EQ("25", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessTelephoneListPID.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListPID.end(), TestFileIter);
ASSERT_EQ("50", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessTelephoneListPref.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListPref.end(), TestFileIntIter);
ASSERT_EQ(75, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessTelephoneListTokens.find(2);
ASSERT_NE(TestFile.BusinessTelephoneListTokens.end(), TestFileIter);
ASSERT_EQ("BEEP=Boop", TestFileIter->second);
}
TEST(ContactLoad, LanguageTests){
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 language.
TestFileIter = TestFile.GeneralLanguageList.find(0);
ASSERT_NE(TestFile.GeneralLanguageList.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralLanguageListAltID.find(0);
ASSERT_NE(TestFile.GeneralLanguageListAltID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralLanguageListPID.find(0);
ASSERT_NE(TestFile.GeneralLanguageListPID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralLanguageListPref.find(0);
ASSERT_NE(TestFile.GeneralLanguageListPref.end(), TestFileIntIter);
ASSERT_EQ(80, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralLanguageListTokens.find(0);
ASSERT_NE(TestFile.GeneralLanguageListTokens.end(), TestFileIter);
ASSERT_EQ("GELFORN=Great", TestFileIter->second);
// Start with the home language.
TestFileIter = TestFile.HomeLanguageList.find(1);
ASSERT_NE(TestFile.HomeLanguageList.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeLanguageListAltID.find(1);
ASSERT_NE(TestFile.HomeLanguageListAltID.end(), TestFileIter);
ASSERT_EQ("22", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeLanguageListPID.find(1);
ASSERT_NE(TestFile.HomeLanguageListPID.end(), TestFileIter);
ASSERT_EQ("45", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeLanguageListPref.find(1);
ASSERT_NE(TestFile.HomeLanguageListPref.end(), TestFileIntIter);
ASSERT_EQ(90, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeLanguageListTokens.find(1);
ASSERT_NE(TestFile.HomeLanguageListTokens.end(), TestFileIter);
ASSERT_EQ("LANGUAGE=yes", TestFileIter->second);
// Start with the business language.
TestFileIter = TestFile.BusinessLanguageList.find(2);
ASSERT_NE(TestFile.BusinessLanguageList.end(), TestFileIter);
ASSERT_EQ("cy", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessLanguageListAltID.find(2);
ASSERT_NE(TestFile.BusinessLanguageListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessLanguageListPID.find(2);
ASSERT_NE(TestFile.BusinessLanguageListPID.end(), TestFileIter);
ASSERT_EQ("15", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessLanguageListPref.find(2);
ASSERT_NE(TestFile.BusinessLanguageListPref.end(), TestFileIntIter);
ASSERT_EQ(20, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessLanguageListTokens.find(2);
ASSERT_NE(TestFile.BusinessLanguageListTokens.end(), TestFileIter);
ASSERT_EQ("FFENSTRI=ie", TestFileIter->second);
}
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);
}
TEST(ContactLoad, RelatedTests){
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 first relation.
TestFileIter = TestFile.GeneralRelatedList.find(0);
ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
ASSERT_EQ("Friend Test", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.GeneralRelatedListType.find(0);
ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
ASSERT_EQ("Kin", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralRelatedListAltID.find(0);
ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
ASSERT_EQ("5", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralRelatedListPID.find(0);
ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralRelatedListPref.find(0);
ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
ASSERT_EQ(20, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralRelatedListTokens.find(0);
ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
ASSERT_EQ("OPTION=Yes", TestFileIter->second);
// Start with the second relation.
TestFileIter = TestFile.GeneralRelatedList.find(1);
ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
ASSERT_EQ("Friend Test Two", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.GeneralRelatedListType.find(1);
ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
ASSERT_EQ("Spouse", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralRelatedListAltID.find(1);
ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
ASSERT_EQ("1", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralRelatedListPID.find(1);
ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
ASSERT_EQ("2", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralRelatedListPref.find(1);
ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
ASSERT_EQ(3, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralRelatedListTokens.find(1);
ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
ASSERT_EQ("OPTION=No", TestFileIter->second);
// Start with the second relation.
TestFileIter = TestFile.GeneralRelatedList.find(2);
ASSERT_NE(TestFile.GeneralRelatedList.end(), TestFileIter);
ASSERT_EQ("Friend Test Three", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.GeneralRelatedListType.find(2);
ASSERT_NE(TestFile.GeneralRelatedListType.end(), TestFileIter);
ASSERT_EQ("Muse", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralRelatedListAltID.find(2);
ASSERT_NE(TestFile.GeneralRelatedListAltID.end(), TestFileIter);
ASSERT_EQ("4", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralRelatedListPID.find(2);
ASSERT_NE(TestFile.GeneralRelatedListPID.end(), TestFileIter);
ASSERT_EQ("5", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralRelatedListPref.find(2);
ASSERT_NE(TestFile.GeneralRelatedListPref.end(), TestFileIntIter);
ASSERT_EQ(6, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralRelatedListTokens.find(2);
ASSERT_NE(TestFile.GeneralRelatedListTokens.end(), TestFileIter);
ASSERT_EQ("OPTION=Maybe", TestFileIter->second);
}
TEST(ContactLoad, URLTests){
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 URL.
TestFileIter = TestFile.GeneralWebsiteList.find(0);
ASSERT_NE(TestFile.GeneralWebsiteList.end(), TestFileIter);
ASSERT_EQ("http://example.com/", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralWebsiteListAltID.find(0);
ASSERT_NE(TestFile.GeneralWebsiteListAltID.end(), TestFileIter);
ASSERT_EQ("0", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralWebsiteListPID.find(0);
ASSERT_NE(TestFile.GeneralWebsiteListPID.end(), TestFileIter);
ASSERT_EQ("1", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.GeneralWebsiteListMediatype.find(0);
ASSERT_NE(TestFile.GeneralWebsiteListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralWebsiteListPref.find(0);
ASSERT_NE(TestFile.GeneralWebsiteListPref.end(), TestFileIntIter);
ASSERT_EQ(2, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralWebsiteListTokens.find(0);
ASSERT_NE(TestFile.GeneralWebsiteListTokens.end(), TestFileIter);
ASSERT_EQ("MEEP=Moo", TestFileIter->second);
// Start with the home URL.
TestFileIter = TestFile.HomeWebsiteList.find(1);
ASSERT_NE(TestFile.HomeWebsiteList.end(), TestFileIter);
ASSERT_EQ("http://example.com/home/", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeWebsiteListAltID.find(1);
ASSERT_NE(TestFile.HomeWebsiteListAltID.end(), TestFileIter);
ASSERT_EQ("10", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeWebsiteListPID.find(1);
ASSERT_NE(TestFile.HomeWebsiteListPID.end(), TestFileIter);
ASSERT_EQ("11", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.HomeWebsiteListMediatype.find(1);
ASSERT_NE(TestFile.HomeWebsiteListMediatype.end(), TestFileIter);
ASSERT_EQ("grass/soggy", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeWebsiteListPref.find(1);
ASSERT_NE(TestFile.HomeWebsiteListPref.end(), TestFileIntIter);
ASSERT_EQ(12, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeWebsiteListTokens.find(1);
ASSERT_NE(TestFile.HomeWebsiteListTokens.end(), TestFileIter);
ASSERT_EQ("BON=Bon", TestFileIter->second);
// Start with the business URL.
TestFileIter = TestFile.BusinessWebsiteList.find(2);
ASSERT_NE(TestFile.BusinessWebsiteList.end(), TestFileIter);
ASSERT_EQ("http://example.com/business/", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessWebsiteListAltID.find(2);
ASSERT_NE(TestFile.BusinessWebsiteListAltID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessWebsiteListPID.find(2);
ASSERT_NE(TestFile.BusinessWebsiteListPID.end(), TestFileIter);
ASSERT_EQ("21", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.BusinessWebsiteListMediatype.find(2);
ASSERT_NE(TestFile.BusinessWebsiteListMediatype.end(), TestFileIter);
ASSERT_EQ("chocolate/yummy", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessWebsiteListPref.find(2);
ASSERT_NE(TestFile.BusinessWebsiteListPref.end(), TestFileIntIter);
ASSERT_EQ(22, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessWebsiteListTokens.find(2);
ASSERT_NE(TestFile.BusinessWebsiteListTokens.end(), TestFileIter);
ASSERT_EQ("YES=No", TestFileIter->second);
}
TEST(ContactLoad, TitleTests){
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 title.
TestFileIter = TestFile.GeneralTitleList.find(0);
ASSERT_NE(TestFile.GeneralTitleList.end(), TestFileIter);
ASSERT_EQ("Lord of Light", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralTitleListAltID.find(0);
ASSERT_NE(TestFile.GeneralTitleListAltID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralTitleListPID.find(0);
ASSERT_NE(TestFile.GeneralTitleListPID.end(), TestFileIter);
ASSERT_EQ("21", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.GeneralTitleListLanguage.find(0);
ASSERT_NE(TestFile.GeneralTitleListLanguage.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralTitleListPref.find(0);
ASSERT_NE(TestFile.GeneralTitleListPref.end(), TestFileIntIter);
ASSERT_EQ(22, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralTitleListTokens.find(0);
ASSERT_NE(TestFile.GeneralTitleListTokens.end(), TestFileIter);
ASSERT_EQ("EEP=LIGHT", TestFileIter->second);
// Start with the home title.
TestFileIter = TestFile.HomeTitleList.find(1);
ASSERT_NE(TestFile.HomeTitleList.end(), TestFileIter);
ASSERT_EQ("Lord of Darkness", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeTitleListAltID.find(1);
ASSERT_NE(TestFile.HomeTitleListAltID.end(), TestFileIter);
ASSERT_EQ("30", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeTitleListPID.find(1);
ASSERT_NE(TestFile.HomeTitleListPID.end(), TestFileIter);
ASSERT_EQ("31", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.HomeTitleListLanguage.find(1);
ASSERT_NE(TestFile.HomeTitleListLanguage.end(), TestFileIter);
ASSERT_EQ("grass/dry", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeTitleListPref.find(1);
ASSERT_NE(TestFile.HomeTitleListPref.end(), TestFileIntIter);
ASSERT_EQ(32, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeTitleListTokens.find(1);
ASSERT_NE(TestFile.HomeTitleListTokens.end(), TestFileIter);
ASSERT_EQ("EEP=DARK", TestFileIter->second);
// Start with the business title.
TestFileIter = TestFile.BusinessTitleList.find(2);
ASSERT_NE(TestFile.BusinessTitleList.end(), TestFileIter);
ASSERT_EQ("Master of the Light & Darkness", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessTitleListAltID.find(2);
ASSERT_NE(TestFile.BusinessTitleListAltID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessTitleListPID.find(2);
ASSERT_NE(TestFile.BusinessTitleListPID.end(), TestFileIter);
ASSERT_EQ("41", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.BusinessTitleListLanguage.find(2);
ASSERT_NE(TestFile.BusinessTitleListLanguage.end(), TestFileIter);
ASSERT_EQ("moths/eew", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessTitleListPref.find(2);
ASSERT_NE(TestFile.BusinessTitleListPref.end(), TestFileIntIter);
ASSERT_EQ(42, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessTitleListTokens.find(2);
ASSERT_NE(TestFile.BusinessTitleListTokens.end(), TestFileIter);
ASSERT_EQ("EEP=BOTH", TestFileIter->second);
}
TEST(ContactLoad, RoleTests){
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 role.
TestFileIter = TestFile.GeneralRoleList.find(0);
ASSERT_NE(TestFile.GeneralRoleList.end(), TestFileIter);
ASSERT_EQ("Ordinary Person", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralRoleListAltID.find(0);
ASSERT_NE(TestFile.GeneralRoleListAltID.end(), TestFileIter);
ASSERT_EQ("50", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralRoleListPID.find(0);
ASSERT_NE(TestFile.GeneralRoleListPID.end(), TestFileIter);
ASSERT_EQ("51", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.GeneralRoleListLanguage.find(0);
ASSERT_NE(TestFile.GeneralRoleListLanguage.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralRoleListPref.find(0);
ASSERT_NE(TestFile.GeneralRoleListPref.end(), TestFileIntIter);
ASSERT_EQ(52, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralRoleListTokens.find(0);
ASSERT_NE(TestFile.GeneralRoleListTokens.end(), TestFileIter);
ASSERT_EQ("ASTERISK=None", TestFileIter->second);
// Start with the home role.
TestFileIter = TestFile.HomeRoleList.find(1);
ASSERT_NE(TestFile.HomeRoleList.end(), TestFileIter);
ASSERT_EQ("Ordinary Lazy Person", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeRoleListAltID.find(1);
ASSERT_NE(TestFile.HomeRoleListAltID.end(), TestFileIter);
ASSERT_EQ("60", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeRoleListPID.find(1);
ASSERT_NE(TestFile.HomeRoleListPID.end(), TestFileIter);
ASSERT_EQ("61", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.HomeRoleListLanguage.find(1);
ASSERT_NE(TestFile.HomeRoleListLanguage.end(), TestFileIter);
ASSERT_EQ("en-GB", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeRoleListPref.find(1);
ASSERT_NE(TestFile.HomeRoleListPref.end(), TestFileIntIter);
ASSERT_EQ(62, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeRoleListTokens.find(1);
ASSERT_NE(TestFile.HomeRoleListTokens.end(), TestFileIter);
ASSERT_EQ("SOMEWHERE=There", TestFileIter->second);
// Start with the business role.
TestFileIter = TestFile.BusinessRoleList.find(2);
ASSERT_NE(TestFile.BusinessRoleList.end(), TestFileIter);
ASSERT_EQ("Company Owner", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessRoleListAltID.find(2);
ASSERT_NE(TestFile.BusinessRoleListAltID.end(), TestFileIter);
ASSERT_EQ("70", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessRoleListPID.find(2);
ASSERT_NE(TestFile.BusinessRoleListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.BusinessRoleListLanguage.find(2);
ASSERT_NE(TestFile.BusinessRoleListLanguage.end(), TestFileIter);
ASSERT_EQ("en-AU", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessRoleListPref.find(2);
ASSERT_NE(TestFile.BusinessRoleListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessRoleListTokens.find(2);
ASSERT_NE(TestFile.BusinessRoleListTokens.end(), TestFileIter);
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);
}
TEST(ContactLoad, NoteTests){
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 note.
TestFileIter = TestFile.GeneralNoteList.find(0);
ASSERT_NE(TestFile.GeneralNoteList.end(), TestFileIter);
ASSERT_EQ("Note\n\nLine 3\nLine 4\nLine 5", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.GeneralNoteListAltID.find(0);
ASSERT_NE(TestFile.GeneralNoteListAltID.end(), TestFileIter);
ASSERT_EQ("90", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.GeneralNoteListPID.find(0);
ASSERT_NE(TestFile.GeneralNoteListPID.end(), TestFileIter);
ASSERT_EQ("91", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.GeneralNoteListLanguage.find(0);
ASSERT_NE(TestFile.GeneralNoteListLanguage.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.GeneralNoteListPref.find(0);
ASSERT_NE(TestFile.GeneralNoteListPref.end(), TestFileIntIter);
ASSERT_EQ(92, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.GeneralNoteListTokens.find(0);
ASSERT_NE(TestFile.GeneralNoteListTokens.end(), TestFileIter);
ASSERT_EQ("WOO=WOOP", TestFileIter->second);
// Start with the home note.
TestFileIter = TestFile.HomeNoteList.find(1);
ASSERT_NE(TestFile.HomeNoteList.end(), TestFileIter);
ASSERT_EQ("Note\n\n\n\nLine 5\nLine 6\nLine 7", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.HomeNoteListAltID.find(1);
ASSERT_NE(TestFile.HomeNoteListAltID.end(), TestFileIter);
ASSERT_EQ("80", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.HomeNoteListPID.find(1);
ASSERT_NE(TestFile.HomeNoteListPID.end(), TestFileIter);
ASSERT_EQ("81", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.HomeNoteListLanguage.find(1);
ASSERT_NE(TestFile.HomeNoteListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.HomeNoteListPref.find(1);
ASSERT_NE(TestFile.HomeNoteListPref.end(), TestFileIntIter);
ASSERT_EQ(82, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.HomeNoteListTokens.find(1);
ASSERT_NE(TestFile.HomeNoteListTokens.end(), TestFileIter);
ASSERT_EQ("MOO=MEEP", TestFileIter->second);
// Start with the business note.
TestFileIter = TestFile.BusinessNoteList.find(2);
ASSERT_NE(TestFile.BusinessNoteList.end(), TestFileIter);
ASSERT_EQ("Note\n\n\n\nLine 8\nLine 9\nLine 10", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.BusinessNoteListAltID.find(2);
ASSERT_NE(TestFile.BusinessNoteListAltID.end(), TestFileIter);
ASSERT_EQ("70", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.BusinessNoteListPID.find(2);
ASSERT_NE(TestFile.BusinessNoteListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.BusinessNoteListLanguage.find(2);
ASSERT_NE(TestFile.BusinessNoteListLanguage.end(), TestFileIter);
ASSERT_EQ("fr", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.BusinessNoteListPref.find(2);
ASSERT_NE(TestFile.BusinessNoteListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.BusinessNoteListTokens.find(2);
ASSERT_NE(TestFile.BusinessNoteListTokens.end(), TestFileIter);
ASSERT_EQ("BOING=BOOP", TestFileIter->second);
}
TEST(ContactLoad, CategoryTests){
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 first category.
TestFileIter = TestFile.CategoriesList.find(0);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category One", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CategoriesListType.find(0);
ASSERT_EQ(TestFile.CategoriesListType.end(), TestFileIter);
// Check the ALTID section.
TestFileIter = TestFile.CategoriesListAltID.find(0);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("40", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CategoriesListPID.find(0);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("41", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.CategoriesListLanguage.find(0);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("en", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CategoriesListPref.find(0);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(42, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CategoriesListTokens.find(0);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("CAT=TAC", TestFileIter->second);
// Start with the second & third category.
// (Category Two, Category Three).
TestFileIter = TestFile.CategoriesList.find(1);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category Two", TestFileIter->second);
TestFileIter = TestFile.CategoriesList.find(2);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category Three", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CategoriesListType.find(1);
ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
TestFileIter = TestFile.CategoriesListType.find(2);
ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.CategoriesListAltID.find(1);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("44", TestFileIter->second);
TestFileIter = TestFile.CategoriesListAltID.find(2);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("44", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CategoriesListPID.find(1);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("46", TestFileIter->second);
TestFileIter = TestFile.CategoriesListPID.find(2);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("46", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.CategoriesListLanguage.find(1);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
TestFileIter = TestFile.CategoriesListLanguage.find(2);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CategoriesListPref.find(1);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(48, TestFileIntIter->second);
TestFileIntIter = TestFile.CategoriesListPref.find(2);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(48, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CategoriesListTokens.find(1);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("TAC=CAT", TestFileIter->second);
TestFileIter = TestFile.CategoriesListTokens.find(2);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("TAC=CAT", TestFileIter->second);
// Start with the third, fourth & fifth category.
// (Category Three,Category Four,Category Five).
TestFileIter = TestFile.CategoriesList.find(3);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category Four", TestFileIter->second.ToStdString());
TestFileIter = TestFile.CategoriesList.find(4);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category Five", TestFileIter->second.ToStdString());
TestFileIter = TestFile.CategoriesList.find(5);
ASSERT_NE(TestFile.CategoriesList.end(), TestFileIter);
ASSERT_EQ("Category Six", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CategoriesListType.find(3);
ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
TestFileIter = TestFile.CategoriesListType.find(4);
ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
TestFileIter = TestFile.CategoriesListType.find(5);
ASSERT_NE(TestFile.CategoriesListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.CategoriesListAltID.find(3);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("84", TestFileIter->second);
TestFileIter = TestFile.CategoriesListAltID.find(4);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("84", TestFileIter->second);
TestFileIter = TestFile.CategoriesListAltID.find(5);
ASSERT_NE(TestFile.CategoriesListAltID.end(), TestFileIter);
ASSERT_EQ("84", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CategoriesListPID.find(3);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("86", TestFileIter->second);
TestFileIter = TestFile.CategoriesListPID.find(4);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("86", TestFileIter->second);
TestFileIter = TestFile.CategoriesListPID.find(5);
ASSERT_NE(TestFile.CategoriesListPID.end(), TestFileIter);
ASSERT_EQ("86", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.CategoriesListLanguage.find(3);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
TestFileIter = TestFile.CategoriesListLanguage.find(4);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
TestFileIter = TestFile.CategoriesListLanguage.find(5);
ASSERT_NE(TestFile.CategoriesListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CategoriesListPref.find(3);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(88, TestFileIntIter->second);
TestFileIntIter = TestFile.CategoriesListPref.find(4);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(88, TestFileIntIter->second);
TestFileIntIter = TestFile.CategoriesListPref.find(5);
ASSERT_NE(TestFile.CategoriesListPref.end(), TestFileIntIter);
ASSERT_EQ(88, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CategoriesListTokens.find(3);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("AAA=BBB", TestFileIter->second);
TestFileIter = TestFile.CategoriesListTokens.find(4);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("AAA=BBB", TestFileIter->second);
TestFileIter = TestFile.CategoriesListTokens.find(4);
ASSERT_NE(TestFile.CategoriesListTokens.end(), TestFileIter);
ASSERT_EQ("AAA=BBB", TestFileIter->second);
}
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::iterator TestStrIter;
std::map::iterator TestFileIter;
std::map::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 TYPE section.
TestFileIter = TestFile.PicturesListType.find(0);
ASSERT_EQ(TestFile.PicturesListType.end(), TestFileIter);
// 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 TYPE section.
TestFileIter = TestFile.PicturesListType.find(1);
ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter);
ASSERT_EQ("home", 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 TYPE section.
TestFileIter = TestFile.PicturesListType.find(2);
ASSERT_NE(TestFile.PicturesListType.end(), TestFileIter);
ASSERT_EQ("work", 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);
}
TEST(ContactLoad, LogoTests){
ContactDataObject TestFile;
// Check that the vCard 4.0 file loads OK.
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
std::map::iterator TestStrIter;
std::map::iterator TestFileIter;
std::map::iterator TestFileIntIter;
// Start with the first photo.
TestStrIter = TestFile.LogosList.find(0);
ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAJUlEQVQoz2NkwAb+//8PYTAyMmLKMjGQDuilhxHudBrbM8zCDQCxHQkPeaUvawAAAABJRU5ErkJggg==",
TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.LogosListPicEncType.find(0);
ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.LogosListPictureType.find(0);
ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.LogosListAltID.find(0);
ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
ASSERT_EQ("70", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.LogosListPID.find(0);
ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the TYPE section.
// Check the MEDIATYPE section.
TestFileIter = TestFile.LogosListMediatype.find(0);
ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.LogosListPref.find(0);
ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.LogosListTokens.find(0);
ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
ASSERT_EQ("MEEP=MOO", TestFileIter->second);
// Start with the second photo.
TestStrIter = TestFile.LogosList.find(1);
ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAHklEQVQoz2NkYPjPgAr+owkwMqIpYGIgHYzqGdx6AAKNAxMN5P6+AAAAAElFTkSuQmCC",
TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.LogosListPicEncType.find(1);
ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.LogosListPictureType.find(1);
ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.LogosListAltID.find(1);
ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
ASSERT_EQ("20", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.LogosListPID.find(1);
ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
ASSERT_EQ("21", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.LogosListType.find(1);
ASSERT_NE(TestFile.LogosListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.LogosListMediatype.find(1);
ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.LogosListPref.find(1);
ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
ASSERT_EQ(22, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.LogosListTokens.find(1);
ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
ASSERT_EQ("BEEP=BOOP", TestFileIter->second);
// Start with the second photo.
TestStrIter = TestFile.LogosList.find(2);
ASSERT_NE(TestFile.LogosList.end(), TestStrIter);
ASSERT_EQ("iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAIAAADdHiL1AAAAIElEQVQoz2MUm53EgApepsxF4XfaoylgYiAdjOoZ3HoAeuQD2WdxRzcAAAAASUVORK5CYII=",
TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.LogosListPicEncType.find(2);
ASSERT_NE(TestFile.LogosListPicEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.LogosListPictureType.find(2);
ASSERT_NE(TestFile.LogosListPictureType.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.LogosListAltID.find(2);
ASSERT_NE(TestFile.LogosListAltID.end(), TestFileIter);
ASSERT_EQ("90", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.LogosListPID.find(2);
ASSERT_NE(TestFile.LogosListPID.end(), TestFileIter);
ASSERT_EQ("91", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.LogosListType.find(2);
ASSERT_NE(TestFile.LogosListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.LogosListMediatype.find(2);
ASSERT_NE(TestFile.LogosListMediatype.end(), TestFileIter);
ASSERT_EQ("image/png", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.LogosListPref.find(2);
ASSERT_NE(TestFile.LogosListPref.end(), TestFileIntIter);
ASSERT_EQ(92, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.LogosListTokens.find(2);
ASSERT_NE(TestFile.LogosListTokens.end(), TestFileIter);
ASSERT_EQ("LOGO=YUP", TestFileIter->second);
}
TEST(ContactLoad, SoundTests){
// 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::iterator TestStrIter;
std::map::iterator TestFileIter;
std::map::iterator TestFileIntIter;
// Sound File A: Morse code X.
std::string SoundA = "T2dnUwACAAAAAAAAAAAqlr5kAAAAAPjSH5UBHgF2b3"
"JiaXMAAAAAAUSsAAAAAAAAgLsAAAAAAAC4AU9nZ1MAAAAAAAAAAAAAKpa+ZAEAAAAJVIuhDzz//"
"///////////////MgN2b3JiaXMsAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxNTAxMDUgKOKb"
"hOKbhOKbhOKbhCkAAAAAAQV2b3JiaXMfQkNWAQAAAQAYY1QpRplS0kqJGXOUMUaZYpJKiaWEFkJ"
"InXMUU6k515xrrLm1IIQQGlNQKQWZUo5SaRljkCkFmVIQS0kldBI6J51jEFtJwdaYa4tBthyEDZ"
"pSTCnElFKKQggZU4wpxZRSSkIHJXQOOuYcU45KKEG4nHOrtZaWY4updJJK5yRkTEJIKYWSSgelU"
"05CSDWW1l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W"
"UUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllF"
"JKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSS"
"imllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkop"
"pZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaW"
"UUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllF"
"JKKaWUUkoplVJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKK"
"aWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSCgCQinAAkHowoQwUGrISAEgF"
"AACMUUopxpyDEDHmGGPQSSgpYsw5xhyUklLlHIQQUmktt8o5CCGk1FJtmXNSWosx5hgz56SkFFv"
"NOYdSUoux5ppr7qS0VmuuNedaWqs115xzzbm0FmuuOdecc8sx15xzzjnnGHPOOeecc84FAOA0OA"
"CAHtiwOsJJ0VhgoSErAYBUAAACGaUYc8456BBSjDnnHIQQIoUYc845CCFUjDnnHHQQQqgYc8w5C"
"CGEkDnnHIQQQgghcw466CCEEEIHHYQQQgihlM5BCCGEEEooIYQQQgghhBA6CCGEEEIIIYQQQggh"
"hFJKCCGEEEIJoZRQAABggQMAQIANqyOcFI0FFhqyEgAAAgCAHJagUs6EQY5Bjw1BylEzDUJMOdG"
"ZYk5qMxVTkDkQnXQSGWpB2V4yCwAAgCAAIMAEEBggKPhCCIgxAABBiMwQCYVVsMCgDBoc5gHAA0"
"SERACQmKBIu7iALgNc0MVdB0IIQhCCWBxAAQk4OOGGJ97whBucoFNU6iAAAAAAAAwA4AEA4KAAI"
"iKaq7C4wMjQ2ODo8AgAAAAAABYA+AAAOD6AiIjmKi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d3murLty7Kt+6qr+rbu+8Jw667wCgAA"
"GHAAAAgwoQwUGrISAIgCAACMYYwxCI1SzjkHoVHKOecgZM5BCCGVzDkIIZSSOQehlJQy5yCUklI"
"IoZSUWgshlJRSawUAABQ4AAAE2KApsThAoSErAYBUAACD41iW55miatqyY0meJ4qqqaq27UiW54"
"miaaqqbVueJ4qmqaqu6+ua54miaaqq6+q6aJqmqaqu67q6Lpqiqaqq67qyrpumqqquK7uy7Oumq"
"qqq68quLPvCqrquK8uybevCsKqu68qybNu2b9y6ruu+7/vCka3rui78wjEMRwEA4AkOAEAFNqyO"
"cFI0FlhoyEoAIAMAgDAGIYMQQgYhhJBSSiGllBIAADDgAAAQYEIZKDRkRQAQJwAAGEMppJRSSim"
"llFJKKaWUUkoppZRSSimllFJKKaWUUkgppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZ"
"RSSimllFJKKaWUUkqppJRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUU"
"koppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJK"
"KaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSim"
"llFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZ"
"RSSimllFJKKaWUUkoplVJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSS"
"imllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSCgCQinAAkHowoQwU"
"GrISAEgFAACMUUopxpyDEDHmGGPQSSgpYsw5xhyUklLlHIQQUmktt8o5CCGk1FJtmXNSWosx5hg"
"z56SkFFvNOYdSUoux5ppr7qS0VmuuNedaWqs115xzzbm0FmuuOdecc8sx15xzzjnnGHPOOeecc8"
"4FAOA0OACAHtiwOsJJ0VhgoSErAYB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
"6qnUz2EHaJnRZpzS1radsrMiKHeodrQ30sIQKDKCNkrwtaOz35knCjAQZZJnTpAd5bP9Wt1LlMB"
"SUJTpBwASCwHA5HAdwXAaAoRNN7MgAKgEJzeSImylPNih8Sm+w5Xa4eV8b3YFJBnpqsMctUfMsK"
"89gkEUtLTvHhUU8NifkeMgU+bNOlqDHhHD0cz1udkYgLMpGQNde4htA9Pds1HHezoitB5xAeC9/"
"tRcpa4QNHAVYD+P9+GBogQa3MHFanBEXy8f8FHJp9q/eHVTvb/Dxhd8oXbYLZ7bY9XnmdSy5MvT"
"oTbkW8W39ptMq5bR0+Z2XrPWTnwamtqY4eKow4NQ35rOiaKk49EpYoqYecozQYDhT04juULDYbJ"
"n7IXeksuXpi2v2irciAXICHx2PAvM4SVoUKcberP+c9c+Pj7unVvPkyBqbwKmHWBSOj4S4e7W5o"
"SH9nHhrW1jnyCtQZClVD86hh6E7vpEDb8Ny+AbwuSlI+b4KyFDt6/fEADBnCOeFgDID42jkBQ+w"
"FjNEAGMJtbcK5WgAODg==";
// Start with Sound A.
TestStrIter = TestFile.SoundsList.find(0);
ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
ASSERT_EQ(SoundA, TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.SoundsListAudioEncType.find(0);
ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.SoundsListAudioType.find(0);
ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.SoundsListAltID.find(0);
ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
ASSERT_EQ("4", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SoundsListPID.find(0);
ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
ASSERT_EQ("1", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SoundsListMediatype.find(0);
ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SoundsListType.find(0);
ASSERT_EQ(TestFile.SoundsListType.end(), TestFileIter);
// Check the LANGUAGE section.
TestFileIter = TestFile.SoundsListLanguage.find(0);
ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SoundsListPref.find(0);
ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
ASSERT_EQ(2, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SoundsListTokens.find(0);
ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
ASSERT_EQ("MEEP=MOO", TestFileIter->second);
// Start with Sound B.
TestStrIter = TestFile.SoundsList.find(1);
ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
ASSERT_EQ(SoundB, TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.SoundsListAudioEncType.find(1);
ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.SoundsListAudioType.find(1);
ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SoundsListType.find(1);
ASSERT_NE(TestFile.SoundsListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.SoundsListAltID.find(1);
ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
ASSERT_EQ("24", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SoundsListPID.find(1);
ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
ASSERT_EQ("21", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SoundsListMediatype.find(1);
ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.SoundsListLanguage.find(1);
ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SoundsListPref.find(1);
ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
ASSERT_EQ(22, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SoundsListTokens.find(1);
ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
ASSERT_EQ("SOUND=WAVE", TestFileIter->second);
// Start with Sound C.
TestStrIter = TestFile.SoundsList.find(2);
ASSERT_NE(TestFile.SoundsList.end(), TestStrIter);
ASSERT_EQ(SoundC, TestStrIter->second);
// Check that it has the correct encoding.
TestFileIter = TestFile.SoundsListAudioEncType.find(2);
ASSERT_NE(TestFile.SoundsListAudioEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second);
// Check that it has the correct image type.
TestFileIter = TestFile.SoundsListAudioType.find(2);
ASSERT_NE(TestFile.SoundsListAudioType.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.SoundsListType.find(2);
ASSERT_NE(TestFile.SoundsListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.SoundsListAltID.find(2);
ASSERT_NE(TestFile.SoundsListAltID.end(), TestFileIter);
ASSERT_EQ("44", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.SoundsListPID.find(2);
ASSERT_NE(TestFile.SoundsListPID.end(), TestFileIter);
ASSERT_EQ("41", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.SoundsListMediatype.find(2);
ASSERT_NE(TestFile.SoundsListMediatype.end(), TestFileIter);
ASSERT_EQ("application/ogg", TestFileIter->second);
// Check the LANGUAGE section.
TestFileIter = TestFile.SoundsListLanguage.find(2);
ASSERT_NE(TestFile.SoundsListLanguage.end(), TestFileIter);
ASSERT_EQ("kw", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.SoundsListPref.find(2);
ASSERT_NE(TestFile.SoundsListPref.end(), TestFileIntIter);
ASSERT_EQ(42, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.SoundsListTokens.find(2);
ASSERT_NE(TestFile.SoundsListTokens.end(), TestFileIter);
ASSERT_EQ("WAVE=SOUND", TestFileIter->second);
}
TEST(ContactLoad, CalendarURITests){
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 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);
}
TEST(ContactLoad, CalendarAddressURITests){
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 a general calendar request address.
TestFileIter = TestFile.CalendarRequestList.find(0);
ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
ASSERT_EQ("http://example.com/request", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CalendarRequestListType.find(0);
ASSERT_EQ(TestFile.CalendarRequestListType.end(), TestFileIter);
// Check the ALTID section.
TestFileIter = TestFile.CalendarRequestListAltID.find(0);
ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
ASSERT_EQ("14", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CalendarRequestListPID.find(0);
ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
ASSERT_EQ("11", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.CalendarRequestListMediatype.find(0);
ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CalendarRequestListPref.find(0);
ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
ASSERT_EQ(12, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CalendarRequestListTokens.find(0);
ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
ASSERT_EQ("REQUEST=YES", TestFileIter->second);
// Start with a home calendar request address.
TestFileIter = TestFile.CalendarRequestList.find(1);
ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
ASSERT_EQ("http://example.com/home/request", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CalendarRequestListType.find(1);
ASSERT_NE(TestFile.CalendarRequestListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.CalendarRequestListAltID.find(1);
ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
ASSERT_EQ("24", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CalendarRequestListPID.find(1);
ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
ASSERT_EQ("21", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.CalendarRequestListMediatype.find(1);
ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
ASSERT_EQ("text/dryplain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CalendarRequestListPref.find(1);
ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
ASSERT_EQ(22, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CalendarRequestListTokens.find(1);
ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
ASSERT_EQ("REQUEST=MAYBE", TestFileIter->second);
// Start with a business calendar request address.
TestFileIter = TestFile.CalendarRequestList.find(2);
ASSERT_NE(TestFile.CalendarRequestList.end(), TestFileIter);
ASSERT_EQ("http://example.com/business/request", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.CalendarRequestListType.find(2);
ASSERT_NE(TestFile.CalendarRequestListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.CalendarRequestListAltID.find(2);
ASSERT_NE(TestFile.CalendarRequestListAltID.end(), TestFileIter);
ASSERT_EQ("34", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.CalendarRequestListPID.find(2);
ASSERT_NE(TestFile.CalendarRequestListPID.end(), TestFileIter);
ASSERT_EQ("31", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.CalendarRequestListMediatype.find(2);
ASSERT_NE(TestFile.CalendarRequestListMediatype.end(), TestFileIter);
ASSERT_EQ("text/stillwetink", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.CalendarRequestListPref.find(2);
ASSERT_NE(TestFile.CalendarRequestListPref.end(), TestFileIntIter);
ASSERT_EQ(32, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.CalendarRequestListTokens.find(2);
ASSERT_NE(TestFile.CalendarRequestListTokens.end(), TestFileIter);
ASSERT_EQ("REQUEST=NO", TestFileIter->second);
}
TEST(ContactLoad, FreeBusyTests){
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 a general calendar free busy address.
TestFileIter = TestFile.FreeBusyList.find(0);
ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
ASSERT_EQ("http://example.com/freebusy", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.FreeBusyListType.find(0);
ASSERT_EQ(TestFile.FreeBusyListType.end(), TestFileIter);
// Check the ALTID section.
TestFileIter = TestFile.FreeBusyListAltID.find(0);
ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
ASSERT_EQ("74", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.FreeBusyListPID.find(0);
ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.FreeBusyListMediatype.find(0);
ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
ASSERT_EQ("text/plain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.FreeBusyListPref.find(0);
ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.FreeBusyListTokens.find(0);
ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=OUT", TestFileIter->second);
// Start with a home calendar free busy address.
TestFileIter = TestFile.FreeBusyList.find(1);
ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
ASSERT_EQ("http://example.com/home/freebusy", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.FreeBusyListType.find(1);
ASSERT_NE(TestFile.FreeBusyListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.FreeBusyListAltID.find(1);
ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
ASSERT_EQ("84", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.FreeBusyListPID.find(1);
ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
ASSERT_EQ("81", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.FreeBusyListMediatype.find(1);
ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
ASSERT_EQ("text/dryplain", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.FreeBusyListPref.find(1);
ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
ASSERT_EQ(82, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.FreeBusyListTokens.find(1);
ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=FREE", TestFileIter->second);
// Start with a business calendar free busy address.
TestFileIter = TestFile.FreeBusyList.find(2);
ASSERT_NE(TestFile.FreeBusyList.end(), TestFileIter);
ASSERT_EQ("http://example.com/business/freebusy", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.FreeBusyListType.find(2);
ASSERT_NE(TestFile.FreeBusyListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.FreeBusyListAltID.find(2);
ASSERT_NE(TestFile.FreeBusyListAltID.end(), TestFileIter);
ASSERT_EQ("94", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.FreeBusyListPID.find(2);
ASSERT_NE(TestFile.FreeBusyListPID.end(), TestFileIter);
ASSERT_EQ("91", TestFileIter->second);
// Check the MEDIATYPE section.
TestFileIter = TestFile.FreeBusyListMediatype.find(2);
ASSERT_NE(TestFile.FreeBusyListMediatype.end(), TestFileIter);
ASSERT_EQ("text/stillwetink", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.FreeBusyListPref.find(2);
ASSERT_NE(TestFile.FreeBusyListPref.end(), TestFileIntIter);
ASSERT_EQ(92, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.FreeBusyListTokens.find(2);
ASSERT_NE(TestFile.FreeBusyListTokens.end(), TestFileIter);
ASSERT_EQ("STATUS=BUSY", TestFileIter->second);
}
TEST(ContactLoad, KeyTests){
ContactDataObject TestFile;
wxString KeyA = "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tClZlcnNpb246IEdudVBHIHYyCgpt"
"UU11QkZaL0JyWVJDQUN2cTNueUl4dXJPOFovMHcwQWdkeUdhN1d2cWRpdk5OWVdEM3dmZkgrSi83"
"R2o1dkNOClJwWFQ5TVI4SEdmR0Jwai9hc0NsajltbjhnRENMcVZJaXF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REFJYkRBVUpBQW5lTkFBS0NSREI0d2taWjdzT1E1Uk5BUUNUSHVjOQpjM1dORURZY1hhV2N6"
"S3ZwN2R4aWJ1YS9FanNxRC85eHNUOHRZUUQrT2VqRndvRmVrbnpZa2RFMmdJb2ZuaDk0CjdKeUh"
"aNDUyTERkamZXQ1BZWFU9Cj16T3NxCi0tLS0tRU5EIFBHUCBQVUJMSUMgS0VZIEJMT0NLLS0tLS"
"0K";
// 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 a general key.
TestFileIter = TestFile.KeyList.find(0);
ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
ASSERT_EQ(KeyA, TestFileIter->second);
// Check the encoding type.
TestFileIter = TestFile.KeyListDataEncType.find(0);
ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second.ToStdString());
// Check the file type.
TestFileIter = TestFile.KeyListDataType.find(0);
ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
ASSERT_EQ("application/pgp-keys", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.KeyListType.find(0);
ASSERT_EQ(TestFile.KeyListType.end(), TestFileIter);
// Check the ALTID section.
TestFileIter = TestFile.KeyListAltID.find(0);
ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
ASSERT_EQ("54", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.KeyListPID.find(0);
ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
ASSERT_EQ("51", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.KeyListPref.find(0);
ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
ASSERT_EQ(52, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.KeyListTokens.find(0);
ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
ASSERT_EQ("KEYS=JUSTONE", TestFileIter->second);
// Start with a work key.
TestFileIter = TestFile.KeyList.find(1);
ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
ASSERT_EQ(KeyB, TestFileIter->second);
// Check the encoding type.
TestFileIter = TestFile.KeyListDataEncType.find(1);
ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second.ToStdString());
// Check the file type.
TestFileIter = TestFile.KeyListDataType.find(1);
ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
ASSERT_EQ("application/pgp-keys", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.KeyListType.find(1);
ASSERT_NE(TestFile.KeyListType.end(), TestFileIter);
ASSERT_EQ("home", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.KeyListAltID.find(1);
ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
ASSERT_EQ("64", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.KeyListPID.find(1);
ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
ASSERT_EQ("61", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.KeyListPref.find(1);
ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
ASSERT_EQ(62, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.KeyListTokens.find(1);
ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
ASSERT_EQ("KEYS=NONE", TestFileIter->second);
// Start with a business key.
TestFileIter = TestFile.KeyList.find(2);
ASSERT_NE(TestFile.KeyList.end(), TestFileIter);
ASSERT_EQ(KeyC, TestFileIter->second);
// Check the encoding type.
TestFileIter = TestFile.KeyListDataEncType.find(2);
ASSERT_NE(TestFile.KeyListDataEncType.end(), TestFileIter);
ASSERT_EQ("base64", TestFileIter->second.ToStdString());
// Check the file type.
TestFileIter = TestFile.KeyListDataType.find(2);
ASSERT_NE(TestFile.KeyListDataType.end(), TestFileIter);
ASSERT_EQ("application/pgp-keys", TestFileIter->second);
// Check the TYPE section.
TestFileIter = TestFile.KeyListType.find(2);
ASSERT_NE(TestFile.KeyListType.end(), TestFileIter);
ASSERT_EQ("work", TestFileIter->second);
// Check the ALTID section.
TestFileIter = TestFile.KeyListAltID.find(2);
ASSERT_NE(TestFile.KeyListAltID.end(), TestFileIter);
ASSERT_EQ("74", TestFileIter->second);
// Check the PID section.
TestFileIter = TestFile.KeyListPID.find(2);
ASSERT_NE(TestFile.KeyListPID.end(), TestFileIter);
ASSERT_EQ("71", TestFileIter->second);
// Check the PREF section.
TestFileIntIter = TestFile.KeyListPref.find(2);
ASSERT_NE(TestFile.KeyListPref.end(), TestFileIntIter);
ASSERT_EQ(72, TestFileIntIter->second);
// Check the extra tokens.
TestFileIter = TestFile.KeyListTokens.find(2);
ASSERT_NE(TestFile.KeyListTokens.end(), TestFileIter);
ASSERT_EQ("KEYS=MISSING", TestFileIter->second);
}
TEST(ContactLoad, VendorTests){
ContactDataObject TestFile;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
std::map::iterator TestFileIter;
std::map::iterator TestFileIntIter;
// Start with the first vendor namespace.
TestFileIter = TestFile.VendorList.find(0);
ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
ASSERT_EQ("Lemon", TestFileIter->second);
TestFileIter = TestFile.VendorListPEN.find(0);
ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
ASSERT_EQ("696", TestFileIter->second);
TestFileIter = TestFile.VendorListElement.find(0);
ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
ASSERT_EQ("CAKE", TestFileIter->second);
// Start with the second vendor namespace.
TestFileIter = TestFile.VendorList.find(1);
ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
ASSERT_EQ("Orange", TestFileIter->second);
TestFileIter = TestFile.VendorListPEN.find(1);
ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
ASSERT_EQ("696", TestFileIter->second);
TestFileIter = TestFile.VendorListElement.find(1);
ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
ASSERT_EQ("DRINK", TestFileIter->second);
// Start with the third vendor namespace.
TestFileIter = TestFile.VendorList.find(2);
ASSERT_NE(TestFile.VendorList.end(), TestFileIter);
ASSERT_EQ("Shiena Nishizawa", TestFileIter->second);
TestFileIter = TestFile.VendorListPEN.find(2);
ASSERT_NE(TestFile.VendorListPEN.end(), TestFileIter);
ASSERT_EQ("696", TestFileIter->second);
TestFileIter = TestFile.VendorListElement.find(2);
ASSERT_NE(TestFile.VendorListElement.end(), TestFileIter);
ASSERT_EQ("MUSIC", TestFileIter->second);
}
TEST(ContactLoad, XTokenTest){
ContactDataObject TestFile;
ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
std::map::iterator TestFileIter;
std::map::iterator TestFileIntIter;
// Three X-FARM variables.
TestFileIter = TestFile.XTokenList.find(0);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Yard", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(0);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FARM", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(1);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Animals", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(1);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FARM", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(2);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Shed", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(2);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FARM;LOCATION=Back;TYPE=Vehicles", TestFileIter->second.ToStdString());
// Three X-DISKSERIAL variables.
TestFileIter = TestFile.XTokenList.find(3);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("14444", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(3);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("DISKSERIAL", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(4);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("7555", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(4);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("DISKSERIAL", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(5);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("3250539032590", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(5);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("DISKSERIAL;STATUS=DESTROYED;TYPE=FLASH", TestFileIter->second.ToStdString());
// Three X-FOODS variables.
TestFileIter = TestFile.XTokenList.find(6);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Lemon Cake", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(6);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FOODS;STATUS=HIGH", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(7);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Starrey Gazey Pie", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(7);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FOODS;STATUS=LOW", TestFileIter->second);
TestFileIter = TestFile.XTokenList.find(8);
ASSERT_NE(TestFile.XTokenList.end(), TestFileIter);
ASSERT_EQ("Cornish Pasties", TestFileIter->second);
TestFileIter = TestFile.XTokenListTokens.find(8);
ASSERT_NE(TestFile.XTokenListTokens.end(), TestFileIter);
ASSERT_EQ("FOODS;STATUS=FAVOURITE;TYPE=CHEESEANDONION", TestFileIter->second.ToStdString());
}