public void Listener_WasCalled_WhenInvoked() { // Arrange var uEventDispatcher = new UEventDispatcher(); bool wasCalled = false; uEventDispatcher.AddEventListener <TestUEvent01>((IUEventData uEventData) => { wasCalled = true; }); // Act uEventDispatcher.Invoke <TestUEvent01>(new UEventData()); // Assert Assert.That(wasCalled, Is.True); }
// Methods ------------------------------- public void Invoke <T>(IUEventData uEventData) where T : IUEvent { _eventDispatcher.Invoke <T>(uEventData); }