DotNameLib
Loading...
Searching...
No Matches
MockAssetManager Class Reference

Mock implementation of IAssetManager for testing. More...

#include <MockAssetManager.hpp>

Inheritance diagram for MockAssetManager:
Collaboration diagram for MockAssetManager:

Public Member Functions

 MockAssetManager (std::filesystem::path mockPath)
const std::filesystem::path & getAssetsPath () const override
 Get the Assets Path object.
std::filesystem::path resolveAsset (const std::filesystem::path &relativePath) const override
 Resolve the full path of an asset given its relative path.
bool assetExists (const std::filesystem::path &) const override
 Check if an asset exists given its relative path.
bool validate () const override
 Validate the asset manager configuration.
void setMockExists (bool exists)
void setMockValid (bool valid)
Public Member Functions inherited from dotnamecpp::assets::IAssetManager
virtual ~IAssetManager ()=default

Detailed Description

Mock implementation of IAssetManager for testing.

Allows controlling behavior for test scenarios without filesystem dependencies.

Constructor & Destructor Documentation

◆ MockAssetManager()

MockAssetManager::MockAssetManager ( std::filesystem::path mockPath)
inlineexplicit

Member Function Documentation

◆ assetExists()

bool MockAssetManager::assetExists ( const std::filesystem::path & relativePath) const
inlinenodiscardoverridevirtual

Check if an asset exists given its relative path.

Parameters
relativePath
Returns
true
false

Implements dotnamecpp::assets::IAssetManager.

Here is the caller graph for this function:

◆ getAssetsPath()

const std::filesystem::path & MockAssetManager::getAssetsPath ( ) const
inlinenodiscardoverridevirtual

Get the Assets Path object.

Returns
const std::filesystem::path&

Implements dotnamecpp::assets::IAssetManager.

Here is the caller graph for this function:

◆ resolveAsset()

std::filesystem::path MockAssetManager::resolveAsset ( const std::filesystem::path & relativePath) const
inlinenodiscardoverridevirtual

Resolve the full path of an asset given its relative path.

Parameters
relativePath
Returns
std::filesystem::path

Implements dotnamecpp::assets::IAssetManager.

Here is the caller graph for this function:

◆ setMockExists()

void MockAssetManager::setMockExists ( bool exists)
inline
Here is the caller graph for this function:

◆ setMockValid()

void MockAssetManager::setMockValid ( bool valid)
inline
Here is the caller graph for this function:

◆ validate()

bool MockAssetManager::validate ( ) const
inlinenodiscardoverridevirtual

Validate the asset manager configuration.

Returns
true
false

Implements dotnamecpp::assets::IAssetManager.

Here is the caller graph for this function:

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