25 #ifndef WDATAHANDLER_TEST_H
26 #define WDATAHANDLER_TEST_H
29 #include <boost/shared_ptr.hpp>
32 #include <cxxtest/TestSuite.h>
34 #include "../../common/WLogger.h"
35 #include "../WSubject.h"
36 #include "../WDataHandler.h"
81 TS_ASSERT_THROWS_NOTHING( dh->addSubject( boost::shared_ptr< WSubject >( s ) ) );
82 TS_ASSERT_EQUALS( 2, dh->m_subjects.size() );
89 for( WDataHandler::SubjectContainerType::const_iterator iter = a->get().begin(); iter != a->get().end(); ++iter )
94 TS_ASSERT( ( count == 1 ) || ( s == ( *iter ).get() ) );
97 TS_ASSERT( count == 2 );
111 boost::shared_ptr< WSubject > s(
new WSubject( testInfo ) );
115 TS_ASSERT_EQUALS( 3, dh->m_subjects.size() );
116 dh->removeSubject( s );
117 TS_ASSERT_EQUALS( 2, dh->m_subjects.size() );
119 TS_ASSERT_EQUALS( 0, dh->m_subjects.size() );
123 #endif // WDATAHANDLER_TEST_H
void testRemoveSubjects()
Test the remove and clean functionality.
void setUp()
Setup logger and other stuff for each test.
Container for all WDataSets belonging to one subject or patient.
Test important functionality of WDataHandler class.
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.
void testInstantiation()
Instatiation should throw nothing.
static boost::shared_ptr< WDataHandler > getDataHandler()
As WDataHandler is a singleton -> return instance.
Provides the environment for storing and accessing different subjects.
void testAddSubjects()
Test adding and iterating subjects.
void testSingleton()
Singleton getter should create an instance.
boost::shared_ptr< WSharedObjectTicketRead< SubjectContainerType > > ReadTicket
Type for read tickets.