// Check the extra tokens parameter.
ASSERT_EQ("TEST=Yes", TestFile.NameTokens);
-
+
+}
+
+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<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::iterator TestFileIntIter;
+
// Check that the nickname has been read (NICKNAME). General.
TestFileIter = TestFile.GeneralNicknamesList.find(0);
}
+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<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::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.
+
+ // 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<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::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 birthday has been read.
+
+ // 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<int,wxString>::iterator TestFileIter;
+ std::map<int,int>::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);
+
+}
+
// TODO: Add tests for the Contact Loading process.
\ No newline at end of file