PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::di::test Namespace Reference

Classes

class  MockNetwork
 Mock network service for testing. More...
 
class  MockStorage
 
class  TestContainerBuilder
 

Functions

std::shared_ptr< kcenon::common::di::service_container > create_test_container ()
 Create a test container with all mock services.
 
void register_mock_storage (kcenon::common::di::IServiceContainer &container, std::shared_ptr< MockStorage > mock)
 Register mock storage with a container.
 
void register_mock_network (kcenon::common::di::IServiceContainer &container, std::shared_ptr< MockNetwork > mock)
 Register mock network with a container.
 

Function Documentation

◆ create_test_container()

std::shared_ptr< kcenon::common::di::service_container > kcenon::pacs::di::test::create_test_container ( )
inlinenodiscard

Create a test container with all mock services.

Returns
Shared pointer to container with mock services
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/di/test_support.h.

Definition at line 365 of file test_support.h.

365 {
366 return TestContainerBuilder()
369 .build();
370}
std::shared_ptr< kcenon::common::di::service_container > build()
Build the configured container.
TestContainerBuilder & with_mock_storage()
Create and use a new mock storage.
TestContainerBuilder & with_mock_network()
Create and use a new mock network.

References kcenon::pacs::di::test::TestContainerBuilder::build(), kcenon::pacs::di::test::TestContainerBuilder::with_mock_network(), and kcenon::pacs::di::test::TestContainerBuilder::with_mock_storage().

Here is the call graph for this function:

◆ register_mock_network()

void kcenon::pacs::di::test::register_mock_network ( kcenon::common::di::IServiceContainer & container,
std::shared_ptr< MockNetwork > mock )
inline

Register mock network with a container.

Parameters
containerThe container to register with
mockThe mock network instance
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/di/test_support.h.

Definition at line 390 of file test_support.h.

392 {
393 container.register_instance<IDicomNetwork>(std::move(mock));
394}
Network service interface for DICOM communication.

◆ register_mock_storage()

void kcenon::pacs::di::test::register_mock_storage ( kcenon::common::di::IServiceContainer & container,
std::shared_ptr< MockStorage > mock )
inline

Register mock storage with a container.

Parameters
containerThe container to register with
mockThe mock storage instance
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/di/test_support.h.

Definition at line 378 of file test_support.h.

380 {
381 container.register_instance<IDicomStorage>(std::move(mock));
382}