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

Test fixture for AddCommand integration tests. More...

#include <IntAddCommandTest.hxx>

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

Protected Member Functions

void SetUp () override
 Sets up the test environment.
void TearDown () override
 Tears down the test environment.
void createTestFile (const std::string &filename, const std::string &content="test content") const
 Creates a test file inside the test directory.
void createTestDirectory (const std::string &dirname) const
 Creates a test directory inside the test directory.

Protected Attributes

std::shared_ptr< MockSubjectmockEventBus
 Mock event bus for capturing system notifications.
std::shared_ptr< RepositoryManagerrepoManager
 Real RepositoryManager instance under test.
std::unique_ptr< AddCommandcommand
 AddCommand instance under test.
std::filesystem::path testDir
 Path to the temporary directory used as the repository root.

Detailed Description

Test fixture for AddCommand integration tests.

Manages the setup and teardown of a temporary, initialized SVCS repository. Provides utility methods to create various file system structures for testing the staging logic of the AddCommand.

Member Function Documentation

◆ createTestDirectory()

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

Creates a test directory inside the test directory.

Parameters
dirnameThe name of the directory to create.

◆ createTestFile()

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

Creates a test file inside the test directory.

Parameters
filenameThe name of the file to create.
contentThe content of the file (defaults to "test content").

◆ SetUp()

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

Sets up the test environment.

Creates a unique temporary directory, changes the current path to it, initializes a repository, and clears initial events.

◆ TearDown()

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

Tears down the test environment.

Restores the original current path and recursively removes the temporary directory.


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