/// fails in some way.
ServerHooks();
- /// @brief Register a Hook
+ /// @brief Register a hook
///
/// Registers a hook and returns the hook index.
///
/// registered.
int registerHook(const std::string& name);
- /// @brief Get Hook Index
+ /// @brief Get hook index
///
/// Returns the index of a hook.
///
/// -1 is returned if no hook of the given name is found.
int getIndex(const std::string& name) const;
- /// @brief Return Number of Hooks
+ /// @brief Return number of hooks
///
/// Returns the total number of hooks registered.
///
return (hooks_.size());
}
- /// @brief Hook Names
+ /// @brief Get hook names
///
/// Return list of hooks registered in the object.
///
EXPECT_TRUE(expected_names == actual_names);
}
+// Check that the count of hooks is correct.
+
+TEST(ServerHooksTest, HookCount) {
+ ServerHooks hooks;
+
+ // Insert the names into the hooks object
+ hooks.registerHook("alpha");
+ hooks.registerHook("betha");
+ hooks.registerHook("gamma");
+ hooks.registerHook("delta");
+
+ // Should be two more hooks that the number we have registered.
+ EXPECT_EQ(6, hooks.getCount());
+}
+
} // Anonymous namespace