Пример #1
0
        public void AssertThat_BlockStoreOpen_OpensPreviouslyCreatedBlockStore()
        {
            var c = BlockStore.Open(_file);

            Assert.IsNotNull(c);
            Assert.AreEqual(c.BlockSize, _store.BlockSize);
        }
Пример #2
0
        public void AssertThat_BlockStoreRead_ReadsZeroForNullBlock()
        {
            using (var str = _store.Open(24, read: true))
            {
                byte[] bytes = new byte[_store.BlockSize];
                str.Read(bytes, 0, _store.BlockSize);

                foreach (byte byt in bytes)
                {
                    Assert.AreEqual(0, byt);
                }
            }
        }
Пример #3
0
 public void AssertThat_BlockStoreOpen_Throws_WhenGivenUninitializedFile()
 {
     BlockStore.Open(MemoryMappedFile.CreateNew(Guid.NewGuid().ToString(), 1000000));
 }