Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
TODOs: Remove TODOs no longer needed from code
[xestiaab/.git] / source / tests / xestiaab_carddav.cpp
index b5e7a6d..6dd7bab 100644 (file)
@@ -21,8 +21,6 @@
 #include <chrono>
 #include <thread>
 
-// TODO: Add tests for the CardDAV object.
-
 TEST(CardDAV, Use_Fake_To_Setup_And_Check_Connection_Settings_With_TestMode_True){
        
        std::string ServerAddress1 = "gibberish.invalid";
@@ -41,6 +39,10 @@ TEST(CardDAV, Use_Fake_To_Setup_And_Check_Connection_Settings_With_TestMode_True
        FakeConnectionObject FakeConnection2(ServerAddress2, 8800, ServerUser2, ServerPass2, true);
        FakeConnectionObject FakeConnection3(ServerAddress3, 8008, ServerUser3, ServerPass3, false);
        
+       FakeConnection1.ResultTestMode = true;
+       FakeConnection2.ResultTestMode = true;
+       FakeConnection3.ResultTestMode = true;
+       
        EXPECT_EQ("gibberish.invalid", FakeConnection1.GetServerAddress());
        EXPECT_EQ(8080, FakeConnection1.GetServerPort());
        EXPECT_EQ("user", FakeConnection1.GetServerUser());
@@ -88,6 +90,10 @@ TEST(CardDAV, Use_Fake_To_Setup_And_Check_Connection_Settings_With_TestMode_Fals
        FakeConnectionObject FakeConnection2(ServerAddress2, 8800, ServerUser2, ServerPass2, true, "/prefix2", "Account2");
        FakeConnectionObject FakeConnection3(ServerAddress3, 8008, ServerUser3, ServerPass3, false, "/prefix3", "Account3");
        
+       FakeConnection1.ResultTestMode = false;
+       FakeConnection2.ResultTestMode = false;
+       FakeConnection3.ResultTestMode = false;
+       
        EXPECT_EQ("gibberish.invalid", FakeConnection1.GetServerAddress());
        EXPECT_EQ(8080, FakeConnection1.GetServerPort());
        EXPECT_EQ("user", FakeConnection1.GetServerUser());
@@ -682,7 +688,7 @@ TEST(CardDAV, Use_Fake_To_Simulate_A_Connection_That_Deletes_A_Server_Contact){
        FakeConnection.TestSessionCode = 0;
        FakeConnection.TestResultMessage = "";
        
-       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf", "a23124sfadfdvxc1646541bsdfaf");
+       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf");
        
        EXPECT_EQ(COREQUEST_OK, DeleteContactResult.RequestResult);
        EXPECT_EQ("", DeleteContactResult.EntityTag);
@@ -696,7 +702,7 @@ TEST(CardDAV, Use_Fake_To_Simulate_A_Connection_That_Deletes_A_Server_Contact){
        FakeConnection.TestSessionCode = 0;
        FakeConnection.TestResultMessage = "";
 
-       DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf", "asf84sa484saf614as64asvada4s6fas");
+       DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf");
 
        EXPECT_EQ(COREQUEST_OK, DeleteContactResult.RequestResult);
        EXPECT_EQ("", DeleteContactResult.EntityTag);
@@ -722,7 +728,7 @@ TEST(CardDAV, Use_Fake_To_Simulate_A_Connection_That_Fails_To_Delete_A_Server_Co
        FakeConnection.TestSessionCode = 22;
        FakeConnection.TestResultMessage = "You do not have permission to delete this resource.";
        
-       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf", "a23124sfadfdvxc1646541bsdfaf");
+       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf");
        
        EXPECT_EQ(COREQUEST_ERROR_SERVER, DeleteContactResult.RequestResult);
        EXPECT_EQ("", DeleteContactResult.EntityTag);
@@ -748,7 +754,7 @@ TEST(CardDAV, Use_Fake_To_Simulate_A_Connection_That_Fails_To_Delete_A_Server_Co
        FakeConnection.TestSessionCode = 22;
        FakeConnection.TestResultMessage = "The resource could not be found.";
        
-       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf", "a23124sfadfdvxc1646541bsdfaf");
+       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf");
        
        EXPECT_EQ(COREQUEST_ERROR_SERVER, DeleteContactResult.RequestResult);
        EXPECT_EQ("", DeleteContactResult.EntityTag);
@@ -774,7 +780,7 @@ TEST(CardDAV, Use_Fake_To_Simulate_A_Connection_That_Fails_To_Delete_A_Server_Co
        FakeConnection.TestSessionCode = 0;
        FakeConnection.TestResultMessage = "";
        
-       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf", "a23124sfadfdvxc1646541bsdfaf");
+       COServerResponse DeleteContactResult = FakeConnection.DeleteContact("testfile.vcf");
        
        EXPECT_EQ(COREQUEST_ERROR_NOTCONNECTED, DeleteContactResult.RequestResult);
        EXPECT_EQ("", DeleteContactResult.EntityTag);
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