private void AssertCartDidntChange()
 {
     new Assert_SetEquals <ProductId, ProductInCart>
     (
         ProductForCart.ToProductInCart(useCase_addProductToCart.ProductsAdd),
         x => x.ProductId
     ).AssertEquals(MarketBridge.GetShoppingCartItems());
 }
Пример #2
0
        private UseCase_AddProductToCart_TestLogic AddProductsToCart(UserInfo user, IEnumerable <ProductForCart> products)
        {
            var useCase_addProductToCart_testLogic = new UseCase_AddProductToCart_TestLogic(SystemContext, user);

            useCase_addProductToCart_testLogic.Setup();
            IEnumerable <ProductInCart> products_add = ProductForCart.ToProductInCart(products);

            useCase_addProductToCart_testLogic.Success_Normal_CheckCartItems(products_add, products_add);
            return(useCase_addProductToCart_testLogic);
        }
        private IEnumerable <ProductInCart> CalculateExpected()
        {
            IDictionary <ProductId, ProductForCart> expected = ProductForCart.ToDictionary(ProductsForCart);

            foreach (ProductIdentifiable productRemoved in ProductsRemove)
            {
                _ = expected.Remove(productRemoved.ProductId);
            }
            return(ProductForCart.ToProductInCart(expected.Values));
        }
Пример #4
0
        public void Success_BasketExists()
        {
            Success_NoBasket();
            IEnumerable <ProductInCart> productsBefore = ProductForCart.ToProductInCart(ProductsAdd);
            IEnumerable <ProductInCart> productsAdd    = new ProductInCart[]
            {
                new ProductInCart(ShopImage.ShopProducts[1].ProductId, 14)
            };
            IEnumerable <ProductInCart> products = productsBefore.Concat(productsAdd);

            testLogic.Success_Normal_CheckCartItems(productsAdd, products);
            testLogic.Products?.AddRange(productsAdd);
        }
Пример #5
0
        public void Success_NoBasket()
        {
            IEnumerable <ProductInCart> products = ProductForCart.ToProductInCart(ProductsAdd);

            testLogic.Success_Normal_CheckCartItems(products, products);
        }