public void DeleteAllforCacheTest() { const int cacheId = 477; // no images in db for that cache Assert.IsFalse(target.DeleteAllForCache(cacheId)); }
public bool DeleteCache(int cacheId) { ValidateCacheOwner(cacheId); // check if there are no assigned log entries or ratings if (logEntryDao.GetLogEntriesForCache(cacheId).Count == 0 || ratingDao.GetRatingsForCache(cacheId).Count == 0) { imageDao.DeleteAllForCache(cacheId); return(cacheDao.Delete(cacheId)); } throw new Exception("Error: Unable to delete cache due to assigned log entries/ratings."); }