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

Google Test fixture for running integration tests against the RemoveCommand. More...

#include <IntRemoveCommandTest.hxx>

Inheritance diagram for svcs::test::cli::utils::RemoveCommandTest:

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.
void createTestFile (const std::string &filename, const std::string &content)
 Creates a test file with specified content in the temporary directory.
void createTestDirectory (const std::string &dirname)
 Creates a test directory in the temporary location.
void stageFiles (const std::vector< std::string > &files)
 Stages a list of files (using the add command logic for convenience) in the RepositoryManager's staging area.
bool containsMessage (const std::vector< Event > &notifications, const std::string &message)
 Checks if a specific message (substring) exists in any event notification.

Protected Attributes

std::shared_ptr< MockSubjectmockEventBus
 Shared pointer to the mock event bus (observer).
std::shared_ptr< RepositoryManagerrepoManager
 Shared pointer to the repository core logic component.
std::unique_ptr< RemoveCommandcommand
 Unique pointer to the command being tested.
std::filesystem::path testDir
 Path to the temporary test repository directory.

Detailed Description

Google Test fixture for running integration tests against the RemoveCommand.

This fixture provides the necessary infrastructure for testing the file removal command, ensuring it correctly stages files for removal from the repository, handles errors, and respects command line options.

Member Function Documentation

◆ containsMessage()

bool svcs::test::cli::utils::RemoveCommandTest::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.

◆ createTestDirectory()

void svcs::test::cli::utils::RemoveCommandTest::createTestDirectory ( const std::string & dirname)
protected

Creates a test directory in the temporary location.

Parameters
dirnameThe relative path/name of the directory.

◆ createTestFile()

void svcs::test::cli::utils::RemoveCommandTest::createTestFile ( const std::string & filename,
const std::string & content )
protected

Creates a test file with specified content in the temporary directory.

Parameters
filenameThe relative path/name of the file.
contentThe content to write to the file.

◆ SetUp()

void svcs::test::cli::utils::RemoveCommandTest::SetUp ( )
overrideprotected

Sets up the testing environment before each test.

Initializes components, creates the temporary directory, and initializes the repository.

◆ stageFiles()

void svcs::test::cli::utils::RemoveCommandTest::stageFiles ( const std::vector< std::string > & files)
protected

Stages a list of files (using the add command logic for convenience) in the RepositoryManager's staging area.

Parameters
filesA vector of file names to stage.

◆ TearDown()

void svcs::test::cli::utils::RemoveCommandTest::TearDown ( )
overrideprotected

Tears down the testing environment after each test.

Cleans up the temporary directory and restores the working path.


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