public List<Beacon> GetAllBeacons() { IronCache cache = new IronCache("509ec7be7e4b7117f2006795", "3zjqFh8J3d382xfzTOFJXNB91Vw"); //var test=cache.Get<string>("Beacon", "AllBeacons"); //var test2 = JsonConvert.DeserializeObject<Beacon>(test); return NHibernateHelper.Session.Query<Beacon>().ToList(); }
public void IronCacheConstructorTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); Assert.IsNotNull(target); }
public void CachesTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); var expected = 1; IList <Cache> actual; actual = target.Caches(); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual.Count); }
public void GetMissingValueTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); string key = "this is an arbitrary key"; string cache = "test_cache"; target.Remove(cache, key); var actual = target.Get <string>(cache, key); Assert.IsNull(actual); }
public void AddGetTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); string value = "this is some arbitrary text"; string key = "this is an arbitrary key"; string cache = "test_cache"; target.Put(cache, key, value); var actual = target.Get <string>(cache, key); Assert.IsNotNull(actual); Assert.AreEqual(value, actual); }
public void AddGetIntTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); int value = 10; string key = "this is an arbitrary key"; string cache = "test_cache"; target.Put(cache, key, value); var actual = target.Get<int?>(cache, key); Assert.IsNotNull(actual); Assert.AreEqual(value, actual); }
public void AddGetTest() { string projectId = _projectId; string token = _token; IronCache target = new IronCache(projectId, token); string value = "this is some arbitrary text"; string key = "this is an arbitrary key"; string cache = "test_cache"; target.Put(cache, key, value); var actual = target.Get<string>(cache, key); Assert.IsNotNull(actual); Assert.AreEqual(value, actual); }
public void IncrementExistingIntegerTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); string key = "cf435dc2-7f12-4f37-94c2-26077b3cd414"; // random unique identifier string cache = "test_cache"; // target.Remove(cache, key); var expected = 1; target.Put(cache, key, 0, false, false, 0); var actual = target.Increment(cache, key, 1); Assert.AreEqual(expected, actual); }
public void IncrementNonExistingTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); string key = "82de17a0-cab9-45a5-a851-bccb210a9e1f"; string cache = "test_cache"; target.Remove(cache, key); try { var actual = target.Increment(cache, key, 1); Assert.Fail(); } catch (KeyNotFoundException) { } }
public void Setup() { var cre = Credentials.LoadFrom(@"..\..\..\..\..\unversioned\ironcache credentials.txt"); _cache = new io.iron.ironcache.IronCache(cre.ProjectId, cre.Token); }
public void GetMissingValueTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); string key = "this is an arbitrary key"; string cache = "test_cache"; target.Remove(cache, key); var actual = target.Get<string>(cache, key); Assert.IsNull(actual); }
public void CachesTest() { string projectId = this.projectId; string token = this.token; IronCache target = new IronCache(projectId, token); var expected = 1; IList<Cache> actual; actual = target.Caches(); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual.Count); }
public IronIOCache(string cacheName, IronIOCredentials ironIoCredentials) { _cacheName = cacheName; _cache = new IronCache(ironIoCredentials.ProjectId, ironIoCredentials.Token); }