Event-Driven Programming in C++ 1.0
A case study on event-driven programming in C++
Loading...
Searching...
No Matches
observer_test.cpp File Reference

Unit tests for the Observer pattern implementation. More...

#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include "observer/observer.hpp"
#include "observer/subject.hpp"

Classes

class  TestObserver
 A test observer that records notification messages. More...
 

Functions

int main ()
 

Detailed Description

Unit tests for the Observer pattern implementation.

This file contains tests for verifying the functionality of the Observer pattern implementation. The tests check that:

  • Observers are notified when the subject sends an event.
  • Multiple observers receive the notification.
  • Removing an observer prevents it from receiving subsequent notifications.

If any assertion fails, the test will abort, indicating an issue with the implementation.

Function Documentation

◆ main()

int main ( )