Пример #1
0
        public void TestReadByte()
        {
            Size limitedSize = new Size(2);

            using (FileStream fileStream = readFileInfo.OpenRead())
                using (LimitedStream limitedStream = new LimitedStream(fileStream, limitedSize))
                {
                    for (long i = 0; i < limitedSize.Bytes; i++)
                    {
                        Assert.AreNotEqual(-1, limitedStream.ReadByte());
                    }

                    Assert.AreEqual(-1, limitedStream.ReadByte());
                    Assert.AreEqual(-1, limitedStream.ReadByte());
                }
        }