Esempio n. 1
0
 public void given_tail_range()
 {
     DataAssert.AreEqual(new[]
     {
         CreateKey(3, 2, "stream1")
     }, Cache.ReadStream("stream1", 1, 1));
 }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public void given_full_range()
 {
     DataAssert.AreEqual(new[]
     {
         CreateKey(1, 1, "stream1"),
         CreateKey(3, 2, "stream1")
     }, Cache.ReadStream("stream1", 0, int.MaxValue));
 }
Esempio n. 4
0
        public void AreEqualDataColumn()
        {
            DataColumn d1 = new DataColumn("Col");
            DataColumn d2 = d1;


            DataAssert.AreEqual(d1, d2);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        public void given_intersecting_range()
        {
            var dataWithKeys = Cache.ReadAll(1, 1);

            DataAssert.AreEqual(new[] { CreateKey(2, 1, "stream2") }, dataWithKeys);
        }