public void Publish_Not_Listening_Type_Of_Event_Test() { // 1) arrange var listener = new CallHandleCounter_MockListener(); internalEventAggregator.Subscribe(listener); var notListeningEvent = new Another_MockEvent(); // 2) act internalEventAggregator.Publish(notListeningEvent); int actual = listener.RepeatTimes; int expected = 0; // 3) assert Assert.Equal(expected, actual); }
public void Publish_Two_Listening_Event_Check_AnotherEvent_Test() { // 1) arrange var listener = new CallHandleCounter_ForTwoEvents_MockListener(); internalEventAggregator.Subscribe(listener); var simplyE = new Simple_MockEvent(); var anotherE = new Another_MockEvent(); // 2) act internalEventAggregator.Publish(simplyE); internalEventAggregator.Publish(anotherE); int actual = listener.RepeatTimesSimplyEvent; int expected = 1; // 3) assert Assert.Equal(expected, actual); }
public void Handle(Another_MockEvent receivedEvent) { RepeatTimesAnotherEvent++; }