public void NotifySuccess_raises_event(InMemoryBusEngine sut, EventMessage <FirstTestEvent> testMessage, EventHandler <MessageEventArgs> handler) { sut.OnMessageNotifySuccess += handler; sut.NotifySuccessAsync(testMessage); sut.OnMessageNotifySuccess -= handler; Mock.Get(handler).Verify(p => p(sut, It.Is <MessageEventArgs>(m => ReferenceEquals(m.Message, testMessage)))); }
public void NotifySuccess_returns_completed_task(InMemoryBusEngine sut, EventMessage <FirstTestEvent> testMessage) { Assert.That(sut.NotifySuccessAsync(testMessage), Is.SameAs(Task.CompletedTask)); }