SVCS - English Documentation
Loading...
Searching...
No Matches
IntVersionCommandTest.hxx
Go to the documentation of this file.
1
19
20#pragma once
21
22#include <gtest/gtest.h>
23#include <memory>
24#include <vector>
25#include <string>
26
29
45namespace svcs::test::cli::utils {
46
47using svcs::services::Event;
50
70class VersionCommandTest : public ::testing::Test {
71protected:
79 void SetUp() override;
80
88 void TearDown() override;
89
92
103 bool containsMessage(const std::vector<Event>& notifications, const std::string& message);
104
118 bool containsExactMessage(const std::vector<Event>& notifications, const std::string& message);
119
127 std::shared_ptr<MockSubject> mockEventBus;
128
136 std::unique_ptr<VersionCommand> command;
137};
138
139}
Declaration of the VersionCommand class for displaying version information.
Command for displaying version information about SVCS.
Definition VersionCommand.hxx:36
A mock implementation of ISubject for testing event-driven components.
Definition MockSubject.hxx:43
Google Test fixture for running unit/integration tests against the VersionCommand.
Definition IntVersionCommandTest.hxx:48
std::shared_ptr< MockSubject > mockEventBus
Shared pointer to the mock event bus for capturing command output.
Definition IntVersionCommandTest.hxx:84
bool containsExactMessage(const std::vector< Event > &notifications, const std::string &message)
Checks if any event notification contains the exact specified message.
Definition IntVersionCommandTest.cxx:39
void SetUp() override
Sets up the testing environment before each test.
Definition IntVersionCommandTest.cxx:22
std::unique_ptr< VersionCommand > command
Unique pointer to the command being tested.
Definition IntVersionCommandTest.hxx:90
void TearDown() override
Tears down the testing environment after each test.
Definition IntVersionCommandTest.cxx:28
bool containsMessage(const std::vector< Event > &notifications, const std::string &message)
Checks if a specific message (substring) exists in any event notification.
Definition IntVersionCommandTest.cxx:32
Mock implementation of the ISubject interface for unit testing purposes.
Utility classes and test fixtures for CLI command testing.
Definition ClearCommandTest.cxx:17