]> git.stg.codes - stg.git/blobdiff - tests/test_reconnect_on_tariff_change.cpp
Added TEST_USERS
[stg.git] / tests / test_reconnect_on_tariff_change.cpp
index 87497f9fc99cc34bb111019a52e0379c47e6f1ba..da0804eaa325a8d536dbd2c9167494023cfbbd83 100644 (file)
@@ -8,6 +8,7 @@
 #include "testadmin.h"
 #include "teststore.h"
 #include "testauth.h"
+#include "testusers.h"
 
 class AFTER_CONNECTED_NOTIFIER : public PROPERTY_NOTIFIER_BASE<bool>,
                                  private NONCOPYABLE {
@@ -59,7 +60,8 @@ namespace tut
         TEST_ADMIN admin;
         TEST_STORE store;
         TEST_AUTH auth;
-        USER_IMPL user(&settings, &store, &tariffs, &admin, NULL);
+        TEST_USERS users;
+        USER_IMPL user(&settings, &store, &tariffs, &admin, &users);
 
         AFTER_CONNECTED_NOTIFIER connectionNotifier;
 
@@ -82,6 +84,8 @@ namespace tut
 
         user.Authorize(inet_strington("127.0.0.1"), 0, &auth);
 
+        ensure_equals("user.authorised_by = true", user.IsAuthorizedBy(&auth), true);
+
         ensure_equals("user.connected = true", user.GetConnected(), true);
         ensure_equals("connects = 1", connectionNotifier.GetConnects(), 1);
         ensure_equals("disconnects = 0", connectionNotifier.GetDisconnects(), 0);