コード例 #1
0
        public void ReadUInt24LE_WithValidUInt24_ReadsData()
        {
            using MemoryStream ms = new MemoryStream(new byte[] { 0x10, 0x0, 0xB });
            using BinaryReader br = new BinaryReader(ms, new ASCIIEncoding());
            var result = EndianUtility.ReadUInt24LE(br);

            Assert.Equal(720912u, result);
        }
コード例 #2
0
 public void ReadUInt24LE_WithInvalidUInt24_ThrowsException()
 {
     using MemoryStream ms = new MemoryStream(new byte[] { 0x10 });
     using BinaryReader br = new BinaryReader(ms, new ASCIIEncoding());
     Assert.Throws <System.IO.EndOfStreamException>(() => EndianUtility.ReadUInt24LE(br));
 }