[63c1f6] | 1 | /*
|
---|
| 2 | * ObserverTest.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Jan 19, 2010
|
---|
| 5 | * Author: crueger
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef OBSERVERTEST_HPP_
|
---|
| 9 | #define OBSERVERTEST_HPP_
|
---|
| 10 |
|
---|
| 11 | #include <cppunit/extensions/HelperMacros.h>
|
---|
| 12 |
|
---|
| 13 | // forward declaration for test stubs
|
---|
| 14 | class UpdateCountObserver;
|
---|
[ccacba] | 15 | class NotificationObserver;
|
---|
[63c1f6] | 16 | class SimpleObservable;
|
---|
| 17 | class CallObservable;
|
---|
| 18 | class SuperObservable;
|
---|
[bd58fb] | 19 | class ObservableCollection;
|
---|
[4fb5a3] | 20 | class BlockObservable;
|
---|
[ccacba] | 21 | class NotificationObservable;
|
---|
[63c1f6] | 22 |
|
---|
| 23 | class ObserverTest : public CppUnit::TestFixture
|
---|
| 24 | {
|
---|
| 25 | CPPUNIT_TEST_SUITE( ObserverTest ) ;
|
---|
| 26 | CPPUNIT_TEST ( doesUpdateTest );
|
---|
| 27 | CPPUNIT_TEST ( doesBlockUpdateTest );
|
---|
| 28 | CPPUNIT_TEST ( doesSubObservableTest );
|
---|
[ccacba] | 29 | CPPUNIT_TEST ( doesNotifyTest );
|
---|
[4fb5a3] | 30 | CPPUNIT_TEST ( doesReportTest );
|
---|
[bd58fb] | 31 | CPPUNIT_TEST ( iteratorTest );
|
---|
[63c1f6] | 32 | CPPUNIT_TEST ( CircleDetectionTest );
|
---|
| 33 | CPPUNIT_TEST_SUITE_END();
|
---|
| 34 |
|
---|
| 35 | public:
|
---|
| 36 | void setUp();
|
---|
| 37 | void tearDown();
|
---|
| 38 |
|
---|
| 39 | void doesUpdateTest();
|
---|
| 40 | void doesBlockUpdateTest();
|
---|
| 41 | void doesSubObservableTest();
|
---|
[ccacba] | 42 | void doesNotifyTest();
|
---|
[4fb5a3] | 43 | void doesReportTest();
|
---|
[bd58fb] | 44 | void iteratorTest();
|
---|
[63c1f6] | 45 | void CircleDetectionTest();
|
---|
| 46 |
|
---|
| 47 | private:
|
---|
| 48 | UpdateCountObserver *observer1;
|
---|
| 49 | UpdateCountObserver *observer2;
|
---|
| 50 | UpdateCountObserver *observer3;
|
---|
[d5f216] | 51 | UpdateCountObserver *observer4;
|
---|
[63c1f6] | 52 |
|
---|
[ccacba] | 53 | NotificationObserver *notificationObserver1;
|
---|
| 54 | NotificationObserver *notificationObserver2;
|
---|
| 55 |
|
---|
[d5f216] | 56 | SimpleObservable *simpleObservable1;
|
---|
| 57 | SimpleObservable *simpleObservable2;
|
---|
[63c1f6] | 58 | CallObservable *callObservable;
|
---|
[4fb5a3] | 59 | BlockObservable *blockObservable;
|
---|
[63c1f6] | 60 | SuperObservable *superObservable;
|
---|
[ccacba] | 61 | NotificationObservable *notificationObservable;
|
---|
[bd58fb] | 62 | ObservableCollection *collection;
|
---|
[a7b761b] | 63 |
|
---|
[63c1f6] | 64 | };
|
---|
| 65 |
|
---|
| 66 | #endif /* OBSERVERTEST_HPP_ */
|
---|