Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added source code, headers and unit testing to the XML vCard Property for ContactData...
[xestiaab/.git] / source / tests / xestiaab_contactload.h
index e2217a1..1f910d2 100644 (file)
@@ -307,6 +307,38 @@ TEST(ContactLoad, SourceTests){
 
 }
 
+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<int,wxString>::iterator TestFileIter;
+       std::map<int,int>::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("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
+    "   href=\"http://example.com/\">Example Page 1</a>", TestFileIter->second);
+
+       TestFileIter = TestFile.XMLList.find(1);
+       ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
+       ASSERT_EQ("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
+    "   href=\"http://example.com/page2.html\">Example Page 2</a>", TestFileIter->second);
+
+       TestFileIter = TestFile.XMLList.find(2);
+       ASSERT_NE(TestFile.XMLList.end(), TestFileIter);
+       ASSERT_EQ("<a xmlns=\"http://www.w3.org/1999/xhtml\"\\n"
+    "   href=\"http://example.com/page3.html\">Example Page 3</a>", TestFileIter->second);
+
+}
+
 TEST(ContactLoad, NicknameTests){
 
        ContactDataObject TestFile;
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