Esempio n. 1
0
        public void GetBytes_ShouldReturnSegmentWithSourceBytes()
        {
            var input = new MemoryStream(new byte[] { 1, 2, 3 });
            var reader = new ByteReader(input);
            reader.GetByte();

            Assert.That(new byte[] { 2, 3 }, Is.SubsetOf(reader.GetBytes(2).Array));
        }
Esempio n. 2
0
        public void EndOfStream_ShouldBeTrueIfAllBytesConsumed()
        {
            var input = new MemoryStream(new byte[] { 1, 2, 3 });
            var reader = new ByteReader(input);
            reader.GetByteReader((int)input.Length);

            Assert.IsTrue(reader.EndOfStream);
        }