Beispiel #1
0
        public void Can_truncate_hash()
        {
            var r = new Random(1234);

            CreateHash();
            for (var i = 0; i < 1000; i++)
            {
                var k = "k" + i;
                var v = TestUtil.GetRandomBytes(r);
                _hash.Put(k, v.ToStream(), v.Length);
            }
            Assert.AreEqual(1000, _hash.Count);
            _hash.Truncate();
            Assert.AreEqual(0, _hash.Count);
        }