public void TestUInt16() { var rnd = new System.Random(); for (var c = 0; c < count; c++) { var mem = new byte[sizeof(UInt16) * writeRepeatCount]; var span1 = new MemoryStreamer(mem); var span2 = new MemoryStreamer(mem); var a = new UInt16[writeRepeatCount]; for (var i = 0; i < writeRepeatCount; i++) { var n = rnd.NextUInt16(); a[i] = n; span1.Write(n); } for (var i = 0; i < writeRepeatCount; i++) { var r = span2.ReadUInt16(); Assert.Equal(a[i], r); } } }