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