Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added initial file save layout and test for LoadCheck-Load4.vcf
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 28 Jun 2016 21:48:18 +0000 (22:48 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 28 Jun 2016 21:48:18 +0000 (22:48 +0100)
source/tests/xestiaab_contactsave.h

index 3459f7c..6020548 100644 (file)
@@ -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
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy