public void Add()
 {
     try
     {
         var toAdd = Tuple.Create(2, "aviad", 2);
         usDB.Add(toAdd);
         li = usDB.Get();
         Assert.AreEqual(li.Count, 2);
     }
     catch (Exception e)
     { Assert.AreEqual(true, false, "there was a connection error to the testing db"); }
 }
Beispiel #2
0
        public Dictionary <NotificationCategories, LinkedList <StoreRole> > initUsersPreferences()
        {
            LinkedList <Tuple <int, String, int> > temp = UNPDB.Get();
            Dictionary <NotificationCategories, LinkedList <StoreRole> > ans = new Dictionary <NotificationCategories, LinkedList <StoreRole> >();

            foreach (Tuple <int, String, int> pref in temp)
            {
                if (!ans.ContainsKey((NotificationCategories)pref.Item1))
                {
                    ans.Add((NotificationCategories)pref.Item1, new LinkedList <StoreRole>());
                }
                StoreRole toadd = StoreManagement.getInstance().getStoreRoleByNameAndStore(pref.Item3, pref.Item2);
                if (toadd != null)
                {
                    ans[(NotificationCategories)pref.Item1].AddFirst(toadd);
                }
            }
            return(ans);
        }