SVCS - English Documentation
Loading...
Searching...
No Matches
svcs::test::cli::VersionCommandTest Class Reference

Google Test fixture for running unit/integration tests against the VersionCommand. More...

#include <IntVersionCommandTest.hxx>

Inheritance diagram for svcs::test::cli::VersionCommandTest:

Protected Member Functions

void SetUp () override
 Sets up the testing environment before each test.
void TearDown () override
 Tears down the testing environment after each test.
bool containsMessage (const std::vector< Event > &notifications, const std::string &message)
 Checks if a specific message (substring) exists in any event notification.
bool containsExactMessage (const std::vector< Event > &notifications, const std::string &message)
 Checks if any event notification contains the exact specified message.

Protected Attributes

std::shared_ptr< MockSubjectmockEventBus
 Shared pointer to the mock event bus for capturing command output.
std::unique_ptr< VersionCommandcommand
 Unique pointer to the command being tested.

Detailed Description

Google Test fixture for running unit/integration tests against the VersionCommand.

This fixture provides the necessary infrastructure for testing the VersionCommand:

  • SetUp/TearDown: Initialize and clean up the mock event bus and the command object.
  • Core Components: Instances of MockSubject (for capturing output) and the VersionCommand itself.
  • Helper Methods: Simplify checking the captured event notifications for specific content.

Member Function Documentation

◆ containsExactMessage()

bool svcs::test::cli::utils::VersionCommandTest::containsExactMessage ( const std::vector< Event > & notifications,
const std::string & message )
protected

Checks if any event notification contains the exact specified message.

Parameters
notificationsThe list of captured events.
messageThe exact message to search for.
Returns
true if an exact match is found, false otherwise.

◆ containsMessage()

bool svcs::test::cli::utils::VersionCommandTest::containsMessage ( const std::vector< Event > & notifications,
const std::string & message )
protected

Checks if a specific message (substring) exists in any event notification.

Parameters
notificationsThe list of captured events.
messageThe substring to search for.
Returns
true if the message is found, false otherwise.

The documentation for this class was generated from the following files: