aboutsummaryrefslogtreecommitdiff
path: root/test/common/Event2Test.cpp
blob: f63a53472d58c840dc6f1a6f47fd25becf150c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "cru/common/Event2.h"

#include <catch2/catch_test_macros.hpp>

using cru::Event2;

TEST_CASE("Event2 handlers should work.", "[event2]") {
  Event2 event;

  int counter = 0;

  auto handler = [&counter] { counter++; };

  event.AddHandler(handler);

  event.Raise();

  REQUIRE(counter == 1);
}