public void test50_ReadWrite()
        {
            string key = "storeKey" + DateTime.Now.Ticks;

            _store.Write(key, _testData);

            var data = _store.Read <Dictionary <string, dynamic> >(key);

            Assert.AreEqual(_testData, data);

            var cacheData = _objCache.Read <Dictionary <string, dynamic> >(key);

            Assert.AreEqual(_testData, cacheData);

            bool isExists = System.IO.File.Exists(_store.StoreDirectory + "/" + key + ".json");

            Assert.IsTrue(isExists);
        }
Example #2
0
 /// <summary>
 /// Find a device by its id
 /// </summary>
 /// <param name="id">id</param>
 /// <returns>list of device on success, false otherwise</returns>
 public Dictionary <string, dynamic> FindById(string id)
 {
     return(_store.Read <Dictionary <string, dynamic> >(string.Format("Device_{0}", id)));
 }
Example #3
0
 /// <summary>
 /// Find a device by its id
 /// </summary>
 /// <param name="id">string id</param>
 /// <returns>array device on success, false otherwise</returns>
 public dynamic FindById(string id)
 {
     return(_store.Read <Dictionary <string, dynamic> >(string.Format("Extra_{0}", id)));
 }