public void Should_Initialize_Correctly()
        {
            //arrange
            Guid id        = Guid.NewGuid();
            Guid pictureId = Guid.NewGuid();

            //act
            var @event = new ProductPictureAddedDomainEvent(id, pictureId);

            //assert
            @event.ProductId.Should().Be(id);
            @event.PictureId.Should().Be(pictureId);
        }
Пример #2
0
        public void AttachPicture(Guid pictureId)
        {
            var picture = new ProductPicture
            {
                ProductId = Id,
                PictureId = pictureId
            };

            Pictures.Add(picture);

            var @event = new ProductPictureAddedDomainEvent(Id, picture.PictureId);

            AddDomainEvent(@event);
        }