Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added remaining source code and units tests for the MEMBER vCard property in ContactD...
[xestiaab/.git] / source / tests / xestiaab_contactload.h
index 2c13711..d7c1210 100644 (file)
@@ -21,7 +21,6 @@
 
 TEST(ContactLoad, ContactLoadTests){
 
-
        ContactDataObject TestFile;
 
        // Check that the file given is not missing.
@@ -37,6 +36,60 @@ TEST(ContactLoad, ContactLoadTests){
        
        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<int,wxString>::iterator TestFileIter;
+       std::map<int,int>::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 that 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);
+       
+
 }
 
 // TODO: Add tests for the Contact Loading process.
\ 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