Esempio n. 1
0
        /// <summary>
        /// Deletes product from the cart.
        /// </summary>
        /// <param name="product">Product to delete.</param>
        public void DeleteFromCart(int id)
        {
            try
            {
                ValidatorClass.CheckProductById(id);
            }
            catch (KeyNotFoundException ex)
            {
                Console.WriteLine(ex.Message);
                return;
            }

            Storage.cart.Remove(id);
        }
 public void CheckById_FailTest()
 {
     ValidatorClass.CheckProductById(67);
 }
        public void CheckById_Test(int id)
        {
            ValidatorClass.CheckProductById(id);

            Assert.IsNotNull(Storage.products[id].Name);
        }