From e2b0fc5fade7f3a6af6761ecb3c3d69d292f78b8 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Tue, 28 Jun 2016 22:48:18 +0100 Subject: [PATCH] Added initial file save layout and test for LoadCheck-Load4.vcf --- source/tests/xestiaab_contactsave.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/tests/xestiaab_contactsave.h b/source/tests/xestiaab_contactsave.h index 3459f7c..6020548 100644 --- a/source/tests/xestiaab_contactsave.h +++ b/source/tests/xestiaab_contactsave.h @@ -24,6 +24,8 @@ TEST(ContactSave, ContactSaveTests){ ContactDataObject TestFile1; ContactDataObject TestFile2; + ContactDataObject TestFile3; + wxString SaveData; wxString SaveDataCompare = "BEGIN:VCARD\n" "VERSION:4.0\n" @@ -36,6 +38,7 @@ TEST(ContactSave, ContactSaveTests){ ASSERT_EQ(CONTACTLOAD_OK, TestFile1.LoadFile("LoadCheck-Load1.vcf")); ASSERT_EQ(CONTACTSAVE_OK, TestFile1.SaveString(&SaveData)); + ASSERT_EQ(SaveDataCompare, SaveData); ASSERT_EQ(CONTACTLOAD_OK, TestFile2.LoadFile("LoadCheck-Load2.vcf")); @@ -52,5 +55,25 @@ TEST(ContactSave, ContactSaveTests){ ASSERT_EQ(CONTACTSAVE_OK, TestFile2.SaveString(&SaveData)); ASSERT_EQ(SaveDataCompare, SaveData); + + SaveData.clear(); + SaveDataCompare = "BEGIN:VCARD\n" + "VERSION:4.0\n" + "PRODID:-//Xestia//Address Book Unit Testing//KW\n" + "FN;TYPE=work;LANGUAGE=kw;ALTID=500;PID=40;PREF=45;EXAMPLE=Baaa:Test Contact\n" + "TITLE;ALTID=20;LANGUAGE=text/plain;PID=21;PREF=22;EEP=LIGHT:Lord of Light\n" + "TITLE;TYPE=home;ALTID=30;LANGUAGE=grass/dry;PID=31;PREF=32;EEP=DARK:Lord of D\n" + " arkness\n" + "TITLE;TYPE=work;ALTID=40;LANGUAGE=moths/eew;PID=41;PREF=42;EEP=BOTH:Master of\n" + " the Light & Darkness\n" + "END:VCARD"; + + ASSERT_EQ(CONTACTLOAD_OK, TestFile3.LoadFile("LoadCheck-Load4.vcf")); + ASSERT_EQ(CONTACTSAVE_OK, TestFile3.SaveString(&SaveData)); + std::cout << SaveData << std::endl; + std::cout << SaveDataCompare << std::endl; + + ASSERT_EQ(SaveDataCompare, SaveData); + } \ No newline at end of file -- 2.39.5