Skip to content

Commit 351a616

Browse files
committed
tests/Execution/EventSystem: Multiple subscribers
1 parent 287ab60 commit 351a616

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/Execution/EventSystem.mpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,22 @@ export namespace CppUtils::UnitTest::Execution::EventSystem
9595
suite.expectCall(expectPingReceived);
9696
suite.expectCall(expectPongReceived);
9797
});
98+
99+
suite.addTest("Multiple subscribers", [&] {
100+
auto eventSystem = CppUtils::Execution::EventSystem{};
101+
auto expect1 = ExpectedCall{};
102+
auto expect2 = ExpectedCall{};
103+
104+
eventSystem.subscribe<"Event">([&expect1](std::nullptr_t) -> void {
105+
expect1.call();
106+
});
107+
eventSystem.subscribe<"Event">([&expect2](std::nullptr_t) -> void {
108+
expect2.call();
109+
});
110+
eventSystem.emit<"Event">(nullptr);
111+
112+
suite.expectCall(expect1);
113+
suite.expectCall(expect2);
114+
});
98115
}};
99116
}

0 commit comments

Comments
 (0)