Esempio n. 1
0
        public void AddProductToShoppingCartForProductIdOrVariantIdOrQuantityIsZero_Test()
        {
            var productId = default(int);
            var variantId = default(int);
            var quantity  = default(int);

            IShoppingCartManager manager = ServiceProvider.GetService <IShoppingCartManager>();

            Assert.ThrowsException <AddProductToShoppingCartException>(() =>
            {
                manager.AddProductToShoppingCart(new AddProductToShoppingCartModel
                {
                    ProductId = productId,
                    VariantId = variantId,
                    Quantity  = quantity
                });
            });
        }
Esempio n. 2
0
        public void AddProductToShoppingCartWithValidDatas_Test()
        {
            var productId      = 1;
            var variantId      = 2;
            var quantity       = 1;
            var shoppingCartId = 1;

            IShoppingCartManager manager = ServiceProvider.GetService <IShoppingCartManager>();

            var result = manager.AddProductToShoppingCart(new AddProductToShoppingCartModel
            {
                ProductId      = productId,
                VariantId      = variantId,
                Quantity       = quantity,
                ShoppingCartId = shoppingCartId
            });


            Assert.AreEqual(true, result);
        }