Exemple #1
0
        public void WriteByte_Writes_Byte_Into_Buffer()
        {
            var buffer = new ArrayBuffer(bufferSize);
            byte @byte = 101;

            buffer.WriteByte(@byte);

            Assert.That(buffer.Length, Is.EqualTo(1));
            Assert.That(buffer[0], Is.EqualTo(@byte));
        }
Exemple #2
0
        public void WriteByte_Throws_Exception_If_Buffer_Full()
        {
            byte[] bufferData = { 1, 2, 3, 4 };
            var buffer = new ArrayBuffer(bufferData, 0, bufferData.Length);

            Assert.That(() => buffer.WriteByte(0), Throws.InstanceOf<InvalidOperationException>());
        }