Example #1
0
        public void Has_Title()
        {
            string title = "My Product";
            var product = new ProductBuilder().WithTitle(title).GetResult();

            Assert.Equal(product.Title, title);
        }
Example #2
0
        public void Has_Id()
        {
            string id = "346598635dfh";
            var product = new ProductBuilder().WithId(id).GetResult();

            Assert.Equal(product.Id, id);
        }
Example #3
0
        public void Has_Summary()
        {
            AggregateFactory.Configure();

            string summary = "My summary";
            var product = new ProductBuilder().WithSummary(summary).AsAggregate<ProductSummaryAggregate>(new AggregateFactory());

            Assert.Equal(product.Summary, summary);
        }
Example #4
0
        public void Has_Description()
        {
            AggregateFactory.Configure();

            string desc = "My description";
            var product = new ProductBuilder().WithDescription(desc).AsAggregate<ProductDetailsAggregate>(new AggregateFactory());

            Assert.Equal(product.Description, desc);
        }
Example #5
0
        public void Has_Categories()
        {
            AggregateFactory.Configure();

            var product = new ProductBuilder()
                .WithCategories(
                    new Category(),
                    new Category()
                )
                .AsAggregate<ProductDetailsAggregate>(new AggregateFactory());

            Assert.Equal(product.Categories.Count(), 2);
        }
Example #6
0
        public void Has_Variants()
        {
            AggregateFactory.Configure();

            var product = new ProductBuilder()
                .WithVariants(
                    new Product(),
                    new Product()
                )
                .AsAggregate<ProductVariantsAggregate>(new AggregateFactory());

            Assert.Equal(product.Variants.Count(), 2);
        }