예제 #1
0
 public void Should_read_and_write_decimals()
 {
     var buffer = new byte[1024];
     using (var wrapper = new UnsafeBufferWrapper(buffer))
     {
         const decimal value = 42.42m;
         wrapper.Write(value);
         Assert.AreEqual(wrapper.Position, sizeof (decimal));
         wrapper.ResetCursor();
         var readValue = wrapper.ReadDecimal();
         Assert.AreEqual(value, readValue);
     }
 }