25 #ifndef WDATAHANDLER_TEST_H
26 #define WDATAHANDLER_TEST_H
30 #include <cxxtest/TestSuite.h>
32 #include "../../common/WLogger.h"
33 #include "../WDataHandler.h"
34 #include "../WSubject.h"
79 TS_ASSERT_THROWS_NOTHING( dh->addSubject( std::shared_ptr< WSubject >( s ) ) );
80 TS_ASSERT_EQUALS( 2, dh->m_subjects.size() );
87 for( WDataHandler::SubjectContainerType::const_iterator iter = a->get().begin(); iter != a->get().end(); ++iter )
92 TS_ASSERT( ( count == 1 ) || ( s == ( *iter ).get() ) );
95 TS_ASSERT( count == 2 );
109 std::shared_ptr< WSubject > s(
new WSubject( testInfo ) );
113 TS_ASSERT_EQUALS( 3, dh->m_subjects.size() );
114 dh->removeSubject( s );
115 TS_ASSERT_EQUALS( 2, dh->m_subjects.size() );
117 TS_ASSERT_EQUALS( 0, dh->m_subjects.size() );
Test important functionality of WDataHandler class.
void testRemoveSubjects()
Test the remove and clean functionality.
void testInstantiation()
Instatiation should throw nothing.
void testSingleton()
Singleton getter should create an instance.
void setUp()
Setup logger and other stuff for each test.
void testAddSubjects()
Test adding and iterating subjects.
Provides the environment for storing and accessing different subjects.
static std::shared_ptr< WDataHandler > getDataHandler()
As WDataHandler is a singleton -> return instance.
static void startup(std::ostream &output=std::cout, LogLevel level=LL_DEBUG)
Create the first and only instance of the logger as it is a singleton.
std::shared_ptr< WSharedObjectTicketRead< T > > ReadTicket
Type for read tickets.
Container for all WDataSets belonging to one subject or patient.