コード例 #1
0
        public void Check_AddProductToCard_If_list_already_contains_2_product()
        {
            //Arrange
            Product     product              = new Product();
            Winkelwagen winkelwagen          = new Winkelwagen(product.id);
            var         winkelwagenDALStub   = new WinkelwagenDALStub();
            var         winkelwagenContainer = new WinkelwagenContainer(winkelwagenDALStub);

            winkelwagenDALStub.ExistReturnValue = false;

            //Act
            var winkelwagenList = winkelwagenContainer.GetList();

            winkelwagen = winkelwagenDALStub.Getproduct(product.id);

            Winkelwagen product1 = new Winkelwagen(product.id);
            Winkelwagen product2 = new Winkelwagen(product.id);

            winkelwagenList.Add(product1);
            winkelwagenList.Add(product2);

            winkelwagenContainer.AddProductToCart(product, winkelwagen);

            var result   = winkelwagenList.Count();
            var expected = 3;

            //Assert
            Assert.Equal(expected, result);
        }
コード例 #2
0
        // Producten toevoegen aan winkelwagen
        public void AddToCard(int productID, int Quantity)
        {
            Product     product     = new Product();
            Winkelwagen winkelwagen = new Winkelwagen(product.id);

            winkelwagen.Prod.id     = productID;
            winkelwagen.hoeveelheid = Quantity;

            SetQuantity(product, winkelwagen);
            winkelwagenContainer.AddProductToCart(product, winkelwagen);
        }
コード例 #3
0
        public void Check_AddProductToCard_1_product()
        {
            //Arrange
            Product     product              = new Product();
            Winkelwagen winkelwagen          = new Winkelwagen(product.id);
            var         winkelwagenDALStub   = new WinkelwagenDALStub();
            var         WinkelwagenContainer = new WinkelwagenContainer(winkelwagenDALStub);

            winkelwagenDALStub.ExistReturnValue = false;

            //Act
            var winkelwagenList = WinkelwagenContainer.GetList();

            WinkelwagenContainer.AddProductToCart(product, winkelwagen);

            var result   = winkelwagenList.Count();
            var expected = 1;

            //Assert
            Assert.Equal(expected, result);
        }