Ejemplo n.º 1
0
 public void Should_read_and_write_bytes()
 {
     var buffer = new byte[1024];
     using (var wrapper = new UnsafeBufferWrapper(buffer))
     {
         const byte value = (byte) 42;
         wrapper.Write(value);
         Assert.AreEqual(wrapper.Position, sizeof (byte));
         wrapper.ResetCursor();
         var readValue = wrapper.ReadByte();
         Assert.AreEqual(value, readValue);
     }
 }