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;
|
---|
15 | class NotificationObserver;
|
---|
16 | class SimpleObservable;
|
---|
17 | class CallObservable;
|
---|
18 | class SuperObservable;
|
---|
19 | class BlockObservable;
|
---|
20 | class NotificationObservable;
|
---|
21 |
|
---|
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 );
|
---|
29 | CPPUNIT_TEST ( doesNotifyTest );
|
---|
30 | CPPUNIT_TEST ( doesReportTest );
|
---|
31 | CPPUNIT_TEST ( CircleDetectionTest );
|
---|
32 | CPPUNIT_TEST_SUITE_END();
|
---|
33 |
|
---|
34 | public:
|
---|
35 | void setUp();
|
---|
36 | void tearDown();
|
---|
37 |
|
---|
38 | void doesUpdateTest();
|
---|
39 | void doesBlockUpdateTest();
|
---|
40 | void doesSubObservableTest();
|
---|
41 | void doesNotifyTest();
|
---|
42 | void doesReportTest();
|
---|
43 | void CircleDetectionTest();
|
---|
44 |
|
---|
45 | private:
|
---|
46 | UpdateCountObserver *observer1;
|
---|
47 | UpdateCountObserver *observer2;
|
---|
48 | UpdateCountObserver *observer3;
|
---|
49 | UpdateCountObserver *observer4;
|
---|
50 |
|
---|
51 | NotificationObserver *notificationObserver1;
|
---|
52 | NotificationObserver *notificationObserver2;
|
---|
53 |
|
---|
54 | SimpleObservable *simpleObservable1;
|
---|
55 | SimpleObservable *simpleObservable2;
|
---|
56 | CallObservable *callObservable;
|
---|
57 | BlockObservable *blockObservable;
|
---|
58 | SuperObservable *superObservable;
|
---|
59 | NotificationObservable *notificationObservable;
|
---|
60 | };
|
---|
61 |
|
---|
62 | #endif /* OBSERVERTEST_HPP_ */
|
---|