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) { } }