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);
173 std::unique_ptr<SaveCommand>
command;
Declaration of the SaveCommand class for saving (committing) staged changes.
Command for saving (committing) staged changes to the repository.
Definition SaveCommand.hxx:37
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 SaveCommand (commit).
Definition IntSaveCommandTest.hxx:51
std::shared_ptr< RepositoryManager > repoManager
Shared pointer to the repository core logic component.
Definition IntSaveCommandTest.hxx:108
std::shared_ptr< MockSubject > mockEventBus
Shared pointer to the mock event bus (observer).
Definition IntSaveCommandTest.hxx:102
std::filesystem::path testDir
Path to the temporary test repository directory.
Definition IntSaveCommandTest.hxx:120
std::unique_ptr< SaveCommand > command
Unique pointer to the command being tested.
Definition IntSaveCommandTest.hxx:114
void stageFiles(const std::vector< std::string > &files)
Stages a list of files using the RepositoryManager's staging logic.
Definition IntSaveCommandTest.cxx:60
void createTestDirectory(const std::string &dirname)
Creates a test directory in the temporary location.
Definition IntSaveCommandTest.cxx:56
bool containsMessage(const std::vector< Event > ¬ifications, const std::string &message)
Checks if a specific message (substring) exists in any event notification.
Definition IntSaveCommandTest.cxx:66
void TearDown() override
Tears down the testing environment after each test.
Definition IntSaveCommandTest.cxx:44
void SetUp() override
Sets up the testing environment before each test.
Definition IntSaveCommandTest.cxx:22
void createTestFile(const std::string &filename, const std::string &content)
Creates a test file with specified content in the temporary directory.
Definition IntSaveCommandTest.cxx:50
Mock implementation of the ISubject interface for unit testing purposes.
Utility classes and test fixtures for CLI command testing.
Definition ClearCommandTest.cxx:17