Пример #1
0
 public Boolean updateStoreRole(StoreRole newPremissions, int storeId, string userName)
 {
     if (!archive.ContainsKey(storeId))
     {
         return(false);
     }
     if (archive[storeId].ContainsKey(userName))
     {
         Tuple <int, String, String, String, String> t = new Tuple <int, String, String, String, String>(storeId, userName, "", "", "");
         SRDDB.Remove(t);
         archive[storeId].Remove(userName);
         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);
     }
     return(false);
 }
 public void RemoveStoreRoleDictionary()
 {
     try
     {
         var toRemove = Tuple.Create(1, "itamar", "Owner", "yossi", "03/03/2030");
         strldDB.Remove(toRemove);
         li = strldDB.Get();
         Assert.AreEqual(li.Count, 0);
     }
     catch (Exception e)
     { Assert.AreEqual(true, false, "there was a connection error to the testing db"); }
 }