Ejemplo n.º 1
0
 /// <summary>
 /// Scan method, takes product code as input parrameter
 /// and add them to cart in case if product code available in pricing.
 /// </summary>
 /// <exception cref="KeyNotFoundException">In case if product code is missing in pricing</exception>
 public void Scan(string productCode)
 {
     if (!prices.ContainsKey(productCode))
     {
         throw new KeyNotFoundException($"You are trying to scan product {productCode} missing in the pricing");
     }
     cart.AddProductItem(productCode);
 }