25#include <gtest/gtest.h>
45using namespace svcs::test::cli::mocks;
94 std::unique_ptr<ClearCommand>
command;
132 void SetUp()
override;
156 void createTestFile(
const std::string& filename,
const std::string& content =
"test content")
const;
Declaration of the ClearCommand class for removing SVCS repository.
Declaration of the RepositoryManager class, managing all repository-level file operations.
Test fixture for ClearCommand integration tests.
Definition ClearCommandTest.hxx:46
std::filesystem::path testDir
Path to the temporary directory used as the repository root.
Definition ClearCommandTest.hxx:70
void createTestFile(const std::string &filename, const std::string &content="test content") const
Creates a test file inside the test directory.
Definition ClearCommandTest.cxx:51
std::shared_ptr< RepositoryManager > repoManager
Real RepositoryManager instance under test.
Definition ClearCommandTest.hxx:58
std::stringstream inputStream
String stream used to feed simulated input to std::cin.
Definition ClearCommandTest.hxx:76
std::streambuf * originalCin
Pointer to the original buffer of std::cin, saved for restoration.
Definition ClearCommandTest.hxx:82
void createTestDirectory(const std::string &dirname) const
Creates a test directory inside the test directory.
Definition ClearCommandTest.cxx:60
void simulateUserInput(const std::string &input)
Simulates user input by redirecting std::cin to a string stream.
Definition ClearCommandTest.cxx:64
std::shared_ptr< MockSubject > mockEventBus
Mock event bus for capturing system notifications.
Definition ClearCommandTest.hxx:52
void SetUp() override
Sets up the test environment.
Definition ClearCommandTest.cxx:19
std::unique_ptr< ClearCommand > command
ClearCommand instance under test.
Definition ClearCommandTest.hxx:64
void TearDown() override
Tears down the test environment.
Definition ClearCommandTest.cxx:37
bool repositoryExists() const
Checks if the .svcs repository directory exists.
Definition ClearCommandTest.cxx:70
Mock implementation of the ISubject interface for unit testing purposes.
Command-line interface components and command implementations.
Core VCS data structures and object model.
Utility classes and test fixtures for CLI command testing.
Definition ClearCommandTest.cxx:17