public void given_tail_range() { DataAssert.AreEqual(new[] { CreateKey(3, 2, "stream1") }, Cache.ReadStream("stream1", 1, 1)); }
public void given_empty_cache_and_valid_commit_function() { var cache = new LockingInMemoryCache(); long?commitStoreVersion = null; long?commitStreamVersion = null; cache.ConcurrentAppend("stream", GetEventBytes(1), (version, storeVersion) => { commitStoreVersion = storeVersion; commitStreamVersion = version; }); Assert.AreEqual(1, commitStoreVersion, "commitStoreVersion"); Assert.AreEqual(1, commitStreamVersion, "commitStreamVersion"); Assert.AreEqual(1, cache.StoreVersion); var expected = new[] { CreateKey(1, 1, "stream"), }; DataAssert.AreEqual(expected, cache.ReadStream("stream", 0, 100)); DataAssert.AreEqual(expected, cache.ReadAll(0, 100)); }
public void given_full_range() { DataAssert.AreEqual(new[] { CreateKey(1, 1, "stream1"), CreateKey(3, 2, "stream1") }, Cache.ReadStream("stream1", 0, int.MaxValue)); }
public void AreEqualDataColumn() { DataColumn d1 = new DataColumn("Col"); DataColumn d2 = d1; DataAssert.AreEqual(d1, d2); }
public void given_full_range() { var dataWithKeys = Cache.ReadAll(0, int.MaxValue); DataAssert.AreEqual(new[] { CreateKey(1, 1, "stream1"), CreateKey(2, 1, "stream2"), CreateKey(3, 2, "stream1") }, dataWithKeys); }
public void given_matching_range() { var dataWithKeys = Cache.ReadAll(0, 3); DataAssert.AreEqual(new[] { CreateKey(1, 1, "stream1"), CreateKey(2, 1, "stream2"), CreateKey(3, 2, "stream1") }, dataWithKeys); }
public void given_intersecting_range() { var dataWithKeys = Cache.ReadAll(1, 1); DataAssert.AreEqual(new[] { CreateKey(2, 1, "stream2") }, dataWithKeys); }