示例#1
0
        public async Task WhenOnlyAuctionDateIsUpdatedThenNameIsNotUpdated()
        {
            var @event = new AuctionUpdatedEvent(_auctionId, null, DateTimeOffset.UtcNow);

            await _handler.HandleAsync(@event);

            var auction = _readStore.GetAll <AuctionReadModel>().Single();

            Assert.Equal("bob", auction.Name);
            Assert.Equal(@event.AuctionDate, auction.AuctionDate);
        }
示例#2
0
        public async Task WhenOnlyNameIsUpdatedThenAuctionDateIsNotUpdated()
        {
            var @event = new AuctionUpdatedEvent(_auctionId, "new-hotness", null);

            await _handler.HandleAsync(@event);

            var auction = _readStore.GetAll <AuctionReadModel>().Single();

            Assert.Equal("new-hotness", auction.Name);
            Assert.Equal(_originalAuctionDate, auction.AuctionDate);
        }