コード例 #1
0
 public void AddDiscount()
 {
     try
     {
         Discount toAdd = new Discount(2, 1, "", 20, "02/02/2030", "COUNTRY=ISRAEL");
         discountDB.Add(toAdd);
         li = discountDB.Get();
         Assert.AreEqual(li.Count, 2);
     }
     catch (Exception e)
     { Assert.AreEqual(true, false, "there was a connection error to the testing db"); }
 }
コード例 #2
0
 private DiscountsManager()
 {
     DDB                        = new DiscountDB(configuration.DB_MODE);
     discounts                  = DDB.Get();
     DiscountCollector          = new System.Timers.Timer();
     DiscountCollector.Elapsed += new ElapsedEventHandler(CheckFinishedDiscounts);
     DiscountCollector.Interval = 60 * 60 * 1000; // interval of one hour
     DiscountCollector.Enabled  = true;
 }