Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added source code, headers and unit tests for the CLIENTPIDMAP vCard Property for...
[xestiaab/.git] / source / tests / xestiaab_contactload.h
index e2217a1..3c72c72 100644 (file)
@@ -169,6 +169,55 @@ TEST(ContactLoad, UIDTest){
 
 }
 
+TEST(ContactLoad, ClientPIDMapTests){
+
+       ContactDataObject TestFile;
+
+       ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
+
+       std::map<int,wxString>::iterator TestFileIter;
+
+       // Test the first Client PID Map.
+
+       TestFileIter = TestFile.ClientPIDList.find(0);
+       ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
+       ASSERT_EQ("1;urn;uuid:aaaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", TestFileIter->second);    
+
+       TestFileIter = TestFile.ClientPIDListTokens.find(0);
+       ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
+
+       // Test the second Client PID Map.
+
+       TestFileIter = TestFile.ClientPIDList.find(1);
+       ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
+       ASSERT_EQ("2;urn;uuid:ccccccccc-cccc-cccc-cccc-cccccccccccc", TestFileIter->second);
+
+       TestFileIter = TestFile.ClientPIDListTokens.find(1);
+       ASSERT_EQ(TestFile.ClientPIDListTokens.end(), TestFileIter);
+       
+       // Test the third Client PID Map.
+       
+       TestFileIter = TestFile.ClientPIDListTokens.find(2);
+       ASSERT_NE(TestFile.ClientPIDListTokens.end(), TestFileIter);
+       ASSERT_EQ("MEEP=MOO;WOOP=WOO", TestFileIter->second);
+
+       TestFileIter = TestFile.ClientPIDList.find(2);
+       ASSERT_NE(TestFile.ClientPIDList.end(), TestFileIter);
+       ASSERT_EQ("3;urn;uuid:bbbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", TestFileIter->second);
+
+}
+
+TEST(ContactLoad, RevisionTests){
+
+       ContactDataObject TestFile;
+
+       ASSERT_EQ(CONTACTLOAD_OK, TestFile.LoadFile("LoadCheck-Load4.vcf"));
+       
+       ASSERT_EQ("20151227T033000Z", TestFile.Revision);
+       ASSERT_EQ("TEST=YES;DATA=NO;MORE=MAYBE", TestFile.RevisionTokens);
+
+}
+
 TEST(ContactLoad, SourceTests){
 
        ContactDataObject TestFile;
@@ -307,6 +356,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