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"); } }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); configuration.DB_MODE = testing; usDB = new UsersNotificationPreferencesDB(testing); li = new LinkedList <Tuple <int, String, int> >();//category(enum),username,storeId usDB.Add(Tuple.Create(1, "itamar", 1)); }
public void signToCategory(StoreRole storeRole, NotificationCategories category) { if (!usersPreferences.ContainsKey(category)) { usersPreferences.Add(category, new LinkedList <StoreRole>()); } foreach (StoreRole sR in usersPreferences[category]) { if (sR.user.getUserName() == storeRole.user.getUserName() && sR.store.getStoreId() == storeRole.store.getStoreId()) { return; } } UNPDB.Add(new Tuple <int, string, int>((int)category, storeRole.getUser().getUserName(), storeRole.getStore().getStoreId())); usersPreferences[category].AddLast(storeRole); }