22#include <gmock/gmock.h>
86 void attach(std::shared_ptr<IObserver> observer)
override {}
97 void detach(std::shared_ptr<IObserver> observer)
override {}
140 if (notification.details.find(message) != std::string::npos) {
160 if (notification.type == type) {
Defines the interface for the Subject (Publisher) component of the Observer pattern.
The Subject (Publisher) Interface (Abstract Base Class).
Definition ISubject.hxx:38
A mock implementation of ISubject for testing event-driven components.
Definition MockSubject.hxx:43
void storeNotification(const Event &event)
Stores a notification in the internal vector (alias for notify functionality).
Definition MockSubject.hxx:119
bool containsEventType(Event::Type type) const
Checks if any captured notification matches the specified Event Type.
Definition MockSubject.hxx:105
void detach(std::shared_ptr< IObserver > observer) override
Satisfies the ISubject interface, but performs no operation.
Definition MockSubject.hxx:63
const std::vector< Event > & getNotifications() const
Returns a constant reference to the notifications vector for inspection.
Definition MockSubject.hxx:136
void clearNotifications()
Clears all notifications from the internal storage.
Definition MockSubject.hxx:127
bool containsMessage(const std::string &message) const
Checks if any captured notification's details contain the specified message substring.
Definition MockSubject.hxx:90
void clear()
Clears all captured notifications.
Definition MockSubject.hxx:80
void notify(const Event &event) const override
Captures the event into the internal notifications vector.
Definition MockSubject.hxx:72
std::vector< Event > notifications
Stores a history of all events received via the notify() method for assertion.
Definition MockSubject.hxx:49
void attach(std::shared_ptr< IObserver > observer) override
Satisfies the ISubject interface, but performs no operation.
Definition MockSubject.hxx:56
Service layer components and infrastructure services.
Mock objects and test doubles for CLI command testing.
Structure describing an event published by the VCS core.
Definition Event.hxx:30
Type
Types of events that can be published.
Definition Event.hxx:35