Exemplo n.º 1
0
        private void CheckFinishedDiscounts(object source, ElapsedEventArgs e)
        {
            LinkedList <Discount> discountToRemove = new LinkedList <Discount>();

            foreach (Discount d in discounts)
            {
                if (DateTime.Now.CompareTo(DateTime.Parse(d.DueDate)) > 0)
                {
                    discountToRemove.AddLast(d);
                }
            }
            foreach (Discount d in discountToRemove)
            {
                DDB.Remove(d);
                discounts.Remove(d);
            }
        }
 public void RemoveDiscount()
 {
     try
     {
         Discount toRemove = new Discount(1, 1, "", 10, "02/02/2020", "");
         discountDB.Remove(toRemove);
         li = discountDB.Get();
         Assert.AreEqual(li.Count, 0);
     }
     catch (Exception e)
     { Assert.AreEqual(true, false, "there was a connection error to the testing db"); }
 }