Esempio n. 1
0
        public void AddImage_when_empty_image_list_adds_image()
        {
            var image = new AuctionImage("id1", "id2", "id3");

            auction.MarkPendingEventsAsHandled();
            auction.AddImage(image);

            var ev = auction.PendingEvents.First() as AuctionImageAdded;

            auction.PendingEvents.Count.Should()
            .Be(1);
            auction.PendingEvents.First()
            .GetType()
            .Should()
            .Be(typeof(AuctionImageAdded));
            ev.AddedImage.Should()
            .Be(image);
            ev.AuctionId.Should()
            .Be(auction.AggregateId);
            ev.Num.Should()
            .Be(0);
        }