public void AddStoreRoleDictionary() { try { var toAdd = Tuple.Create(1, "itamar", "Owner", "yossi", "03/03/2030"); strldDB.Add(toAdd); li = strldDB.Get(); Assert.AreEqual(li.Count, 2); } catch (Exception e) { Assert.AreEqual(true, false, "there was a connection error to the testing db"); } }
public Boolean addStoreRole(StoreRole newPremissions, int storeId, string userName) { if (!archive.ContainsKey(storeId)) { archive.Add(storeId, new Dictionary <string, StoreRole>()); } if (archive[storeId].ContainsKey(userName)) { return(false); } Tuple <int, String, String, String, String> t = new Tuple <int, String, String, String, String>(storeId, userName, newPremissions.type, newPremissions.addedby, newPremissions.dateAdded); SRDDB.Add(t); archive[storeId].Add(userName, newPremissions); return(true); }
public void init() { WebServices.DAL.CleanDB cDB = new WebServices.DAL.CleanDB(); cDB.emptyDB(); configuration.DB_MODE = testing; strldDB = new StoreRoleDictionaryDB(testing); li = new LinkedList <Tuple <int, String, String, String, String> >();//storeId,username,storeRole,addedy,timeadded strldDB.Add(Tuple.Create(1, "itamar", "Owner", "yossi", "03/03/2030")); }