public void TestReadUInt32() { using (var cfile = new CFile(BuildStream(new byte[] { 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA, 0x98 }))) { Assert.Equal((uint)0x78563412, cfile.ReadUInt32()); Assert.Equal(0x98BADCFE, cfile.ReadUInt32()); Assert.Equal((uint)0, cfile.ReadUInt32()); Assert.Equal(true, cfile.EOF); } using (var cfile = new CFile(BuildStream(new byte[] { 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA }))) { Assert.Equal((uint)0x78563412, cfile.ReadUInt32()); Assert.Equal((uint)0, cfile.ReadUInt32()); Assert.Equal((uint)0, cfile.ReadUInt32()); Assert.Equal(true, cfile.EOF); } using (var cfile = new CFile(BuildStream(new byte[] { 97, 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA, 0x98 }))) { Assert.Equal('a', cfile.ReadChar()); Assert.Equal((uint)0x78563412, cfile.ReadUInt32()); Assert.Equal(0x98BADCFE, cfile.ReadUInt32()); Assert.Equal((uint)0, cfile.ReadUInt32()); Assert.Equal(true, cfile.EOF); } }
public void TestReadUInt32() { using (var cfile = new CFile(BuildStream(new byte[] { 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA, 0x98 }))) { Assert.AreEqual((uint)0x78563412, cfile.ReadUInt32()); Assert.AreEqual(0x98BADCFE, cfile.ReadUInt32()); Assert.AreEqual((uint)0, cfile.ReadUInt32()); Assert.AreEqual(true, cfile.EOF); } using (var cfile = new CFile(BuildStream(new byte[] { 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA }))) { Assert.AreEqual((uint)0x78563412, cfile.ReadUInt32()); Assert.AreEqual((uint)0, cfile.ReadUInt32()); Assert.AreEqual((uint)0, cfile.ReadUInt32()); Assert.AreEqual(true, cfile.EOF); } using (var cfile = new CFile(BuildStream(new byte[] { 97, 0x12, 0x34, 0x56, 0x78, 0xFE, 0xDC, 0xBA, 0x98 }))) { Assert.AreEqual('a', cfile.ReadChar()); Assert.AreEqual((uint)0x78563412, cfile.ReadUInt32()); Assert.AreEqual(0x98BADCFE, cfile.ReadUInt32()); Assert.AreEqual((uint)0, cfile.ReadUInt32()); Assert.AreEqual(true, cfile.EOF); } }