24#include <gtest/gtest.h>
50using svcs::services::Event;
85 void SetUp()
override;
109 void createTestFile(
const std::string& filename,
const std::string& content);
131 void stageFiles(
const std::vector<std::string>& files);
146 bool containsMessage(
const std::vector<Event>& notifications,
const std::string& message);
161 int countMessages(
const std::vector<Event>& notifications,
const std::string& message);
188 std::unique_ptr<StatusCommand>
command;
Declaration of the StatusCommand class for showing repository status.
Command for showing the current status of the repository.
Definition StatusCommand.hxx:43
Manages all physical file and directory operations within the SVCS repository.
Definition RepositoryManager.hxx:83
A mock implementation of ISubject for testing event-driven components.
Definition MockSubject.hxx:43
Google Test fixture for running integration tests against the StatusCommand.
Definition IntStatusCommandTest.hxx:51
void stageFiles(const std::vector< std::string > &files)
Stages a list of files using the RepositoryManager's staging logic.
Definition IntStatusCommandTest.cxx:62
void createTestFile(const std::string &filename, const std::string &content)
Creates a test file with specified content in the temporary directory.
Definition IntStatusCommandTest.cxx:52
void createTestDirectory(const std::string &dirname)
Creates a test directory in the temporary location.
Definition IntStatusCommandTest.cxx:58
std::unique_ptr< StatusCommand > command
Unique pointer to the command being tested.
Definition IntStatusCommandTest.hxx:123
std::shared_ptr< MockSubject > mockEventBus
Shared pointer to the mock event bus (observer).
Definition IntStatusCommandTest.hxx:111
bool containsMessage(const std::vector< Event > ¬ifications, const std::string &message)
Checks if a specific message (substring) exists in any event notification.
Definition IntStatusCommandTest.cxx:68
std::filesystem::path testDir
Path to the temporary test repository directory.
Definition IntStatusCommandTest.hxx:129
void TearDown() override
Tears down the testing environment after each test.
Definition IntStatusCommandTest.cxx:46
std::shared_ptr< RepositoryManager > repoManager
Shared pointer to the repository core logic component.
Definition IntStatusCommandTest.hxx:117
int countMessages(const std::vector< Event > ¬ifications, const std::string &message)
Counts the occurrences of a specific message (substring) across all event notifications.
Definition IntStatusCommandTest.cxx:75
void SetUp() override
Sets up the testing environment before each test.
Definition IntStatusCommandTest.cxx:23
Mock implementation of the ISubject interface for unit testing purposes.
Utility classes and test fixtures for CLI command testing.
Definition ClearCommandTest.cxx:17