public void Product_Should_Be_Approved()
        {
            var productId = Random <Guid>();
            var @event    = new ProductApproved(productId);

            ScenarioForExisting()
            .Given(
                () =>
            {
                var aggregate       = Product.Create(productId, Random <int>(), Random <int>(), Random <string>());
                var slicerAttribute = new AttributeRef(Random <int>(), Random <int>());
                aggregate.AddContent(Random <string>(), Random <string>(), slicerAttribute);
                var varianterAttribute = new AttributeRef(Random <int>(), Random <int>());
                aggregate.AddVariant(Random <string>(), slicerAttribute, varianterAttribute);
                aggregate.AssignImage(Random <ImageRef>(), varianterAttribute);
                return(aggregate);
            })
            .When(
                product => product.Approve())
            .Then(@event)
            .AlsoAssert(product => product.IsApproved);
        }
Пример #2
0
 private void Apply(ProductApproved @event) => IsApproved = true;