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

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

            Assert.Equal(product.Id, id);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }