public async Task WhenAuctionItemAddedThenItemIsAddedToAuctionReadModel() { var @event = new AuctionItemAddedEvent(_auctionId, new AuctionItem("something", "boy")); await _handler.HandleAsync(@event); Assert.Single(_readStore.GetAll <AuctionItemReadModel>()); }
public async Task WhenAuctionItemAddedThenItemIsPopulatedFromEvent() { var @event = new AuctionItemAddedEvent(_auctionId, new AuctionItem("something", "boy", "description", 65)); await _handler.HandleAsync(@event); var item = _readStore.GetAll <AuctionItemReadModel>().Single(); Assert.Equal(_auctionId.ToString(), item.AuctionId); Assert.Equal("something", item.Name); Assert.Equal("boy", item.Donor); Assert.Equal("description", item.Description); Assert.Equal(65, item.Quantity); }