public void When_GetEvent_is_called_should_return_correct_event() { var expected = new MockEvent(); var ea = new AsyncEventAggregator(); var e = ea.GetEvent <MockEvent>(); e.GetType().ShouldBeEquivalentTo(expected.GetType()); }
private MockEvent GivenEvent() { var givenEvent = new MockEvent() { Id = Guid.NewGuid() }; dbContext.OutboxEvents.Add(new OutboxEvent() { CreatedDate = DateTimeOffset.Now, EventName = givenEvent.GetType().AssemblyQualifiedName, Payload = JsonSerializer.Serialize(givenEvent) }); dbContext.SaveChanges(); return(givenEvent); }