Example #1
0
        public void ExtractStoreTimestamp()
        {
            string      key   = "test";
            long        ts    = DateTime.Now.GetMilliseconds();
            List <byte> bytes = new List <byte>();

            bytes.AddRange(Encoding.UTF8.GetBytes(key));
            bytes.AddRange(BitConverter.GetBytes(ts));
            long r = WindowKeySchema.ExtractStoreTimestamp(bytes.ToArray());

            Assert.AreEqual(ts, r);
        }
Example #2
0
        public void ExtractStoreKeyBytesTest()
        {
            var bytes = new byte[10] {
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9
            };
            var expected = new byte[2] {
                0, 1
            };
            var r = WindowKeySchema.ExtractStoreKeyBytes(bytes);

            Assert.AreEqual(expected, r);
        }