Пример #1
0
 public void GetPageWithoutCapacity()
 {
     using (var stream = new RingMemoryStream(SmallBufferSize))
     {
         stream.GetPage(0, SmallBufferSize);
     }
 }
Пример #2
0
        public void GetTooLargeSinglePage()
        {
            using (var stream = new RingMemoryStream(SmallBufferSize))
            {
                stream.Capacity = SmallBufferSize * 2;

                stream.GetPage(0, SmallBufferSize * 2);
            }
        }
Пример #3
0
        public void GetCorrectSinglePage()
        {
            using (var stream = new RingMemoryStream(SmallBufferSize))
            {
                stream.Capacity++;

                var page = stream.GetPage(0, SmallBufferSize);

                Assert.AreEqual(0, page.Offset);
                Assert.AreEqual(SmallBufferSize, page.Count);
            }
        }