Exemplo n.º 1
0
        public void WhenTwoisSelectedAndAddisClickedTwoProductsAreAdded()
        {
            //Arrange
            MainWindow windowTest = new MainWindow();

            List<Product> catalogProducts = new List<Product>()
            {
                new Product(){Name = "cable", OnHand = 5},
                new Product(){Name = "charger", OnHand = 4},
                new Product() {Name = "battery", OnHand = 3}
            };

            //Act
            windowTest.cbQuantity.SelectedItem = "2";
            windowTest.lstSelection.SelectedItem = "battery";
            windowTest.AddItemToCart();

            //Assert
            Assert.AreEqual(2, windowTest.orderRepo.CartItems[3].Quantity);
        }