Google Test fixture for running integration tests against the RemoveCommand.
More...
#include <IntRemoveCommandTest.hxx>
|
| 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 > ¬ifications, const std::string &message) |
| | Checks if a specific message (substring) exists in any event notification.
|
|
|
std::shared_ptr< MockSubject > | mockEventBus |
| | Shared pointer to the mock event bus (observer).
|
|
std::shared_ptr< RepositoryManager > | repoManager |
| | Shared pointer to the repository core logic component.
|
|
std::unique_ptr< RemoveCommand > | command |
| | Unique pointer to the command being tested.
|
|
std::filesystem::path | testDir |
| | Path to the temporary test repository directory.
|
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.
◆ 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
-
| notifications | The list of captured events. |
| message | The 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
-
| dirname | The 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
-
| filename | The relative path/name of the file. |
| content | The 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
-
| files | A 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: