]> git.stg.codes - stg.git/commitdiff
Added more tests for filtering params.
authorMaxim Mamontov <faust.madf@gmail.com>
Fri, 2 Sep 2016 19:42:57 +0000 (22:42 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Fri, 2 Sep 2016 19:42:57 +0000 (22:42 +0300)
tests/test_filter_params_log.cpp

index ab7a30977c54deb33a02bd50b563e72f48f7788c..e2cd3acbf5d07713bc01f037e85b3e72e4dbab00 100644 (file)
@@ -86,6 +86,14 @@ namespace tut
         note.Set("another note", &admin, "", &store, "");
 
         ensure_equals("entries = 4", store.GetEntries(), 4);
+
+        address.Set("new address", &admin, "", &store, "");
+
+        ensure_equals("entries = 5", store.GetEntries(), 5);
+
+        group.Set("administrative group", &admin, "", &store, "");
+
+        ensure_equals("entries = 6", store.GetEntries(), 6);
     }
 
 
@@ -122,6 +130,10 @@ namespace tut
         address.Set("new address", &admin, "", &store, "");
 
         ensure_equals("entries = 2", store.GetEntries(), 2);
+
+        group.Set("administrative group", &admin, "", &store, "");
+
+        ensure_equals("entries = 2", store.GetEntries(), 2);
     }
 
     template<>
@@ -163,4 +175,42 @@ namespace tut
 
         ensure_equals("entries = 4", store.GetEntries(), 4);
     }
+
+    template<>
+    template<>
+    void testobject::test<4>()
+    {
+        set_test_name("Check empty filter.");
+
+        TEST_SETTINGS_LOCAL settings;
+        TEST_TARIFFS tariffs;
+        TEST_ADMIN admin;
+        TEST_STORE_LOCAL store;
+        TEST_AUTH auth;
+        TEST_USERS users;
+        TEST_SERVICES services;
+        USER_IMPL user(&settings, &store, &tariffs, &admin, &users, services);
+
+        USER_PROPERTY_LOGGED<std::string> & address(user.GetProperty().address);
+        USER_PROPERTY_LOGGED<std::string> & note(user.GetProperty().note);
+        USER_PROPERTY_LOGGED<std::string> & group(user.GetProperty().group);
+
+        address.Set("address", &admin, "", &store, "");
+        note.Set("note", &admin, "", &store, "");
+        group.Set("group", &admin, "", &store, "");
+
+        ensure_equals("entries = 0", store.GetEntries(), 0);
+
+        note.Set("another note", &admin, "", &store, "");
+
+        ensure_equals("entries = 0", store.GetEntries(), 0);
+
+        address.Set("new address", &admin, "", &store, "");
+
+        ensure_equals("entries = 0", store.GetEntries(), 0);
+
+        group.Set("administrative group", &admin, "", &store, "");
+
+        ensure_equals("entries = 0", store.GetEntries(), 0);
+    }
 }