コード例 #1
0
        private void CheckFinishedRaffelSales(object source, ElapsedEventArgs e)
        {
            LinkedList <RaffleSale> raffleSalesToRemove = new LinkedList <RaffleSale>();

            foreach (RaffleSale rs in raffleSales)
            {
                if (DateTime.Now.CompareTo(DateTime.Parse(rs.DueDate)) > 0)
                {
                    string message = "the Raffle sale " + rs.SaleId + " has been canceled";
                    NotificationPublisher.getInstance().publish(NotificationPublisher.NotificationCategories.RaffleSale, message, rs.SaleId);
                    //NotificationManager.getInstance().notifyUser(rs.UserName, message);
                    raffleSalesToRemove.AddLast(rs);
                }
            }
            foreach (RaffleSale rs in raffleSalesToRemove)
            {
                RSDB.Remove(rs);
                raffleSales.Remove(rs);
            }
        }
コード例 #2
0
 public void RemoveRaffleSale()
 {
     try
     {
         RaffleSale toRemove = new RaffleSale(1, "itamar", 500, "02/02/2020");
         raffDB.Remove(toRemove);
         li = raffDB.Get();
         Assert.AreEqual(li.Count, 0);
     }
     catch (Exception e)
     { Assert.AreEqual(true, false, "there was a connection error to the testing db"); }
 }