public async Task WhenAuctionCreatedThenAuctionIsAddedToReadStore() { var @event = new AuctionCreatedEvent(new AuctionId(), "one", DateTimeOffset.UtcNow); await _handler.HandleAsync(@event); Assert.Single(_readStore.GetAll <AuctionReadModel>()); }
public async Task WhenAuctionCreatedThenAuctionIsPopulatedFromCreatedEvent() { var @event = new AuctionCreatedEvent(new AuctionId(), "one", DateTimeOffset.UtcNow); await _handler.HandleAsync(@event); var model = _readStore.GetAll <AuctionReadModel>().Single(); Assert.Equal(@event.AggregateId.ToString(), model.Id); Assert.Equal("one", model.Name); Assert.Equal(@event.AuctionDate, model.AuctionDate); }