public void SignalEx_AddListenerAndDispatch_Success() { // Arrange var actual = 0; // Act var signal = new SignalEx(); signal.AddListener(ActionRuntime); signal.Dispatch(); void ActionRuntime() => actual++; //Assert Assert.AreEqual(1, actual); }
public void SignalEx_RemoveAllListeners_Success() { // Arrange var actual = 0; // Act var signal = new SignalEx(); signal.AddListener(ActionRuntime); signal.AddListenerOnce(ActionRuntime); signal.RemoveAllListeners(); signal.Dispatch(); void ActionRuntime() => actual++; //Assert Assert.AreEqual(0, actual); }