public void Ubjl_Int32() { var ubjl = new UbjsonReader(new byte[] { 0x6C, 0x12, 0x34, 0x56, 0x78 }); var o = ubjl.Read(); Assert.AreEqual(0x12345678, (int)o); }
public void Ubjl_UInt8() { var ubjl = new UbjsonReader(new byte[] { 0x55, 0xFF }); var o = ubjl.Read(); Assert.AreEqual((byte)255, (byte)o); }
public void Ubjl_Int16() { var ubjl = new UbjsonReader(new byte[] { 0x49, 0xFF, 0xF8 }); var o = ubjl.Read(); Assert.AreEqual((short)-8, (short)o); }
public void Ubjl_Float64() { var ubjl = new UbjsonReader(B(new byte[] { 0x44 }, B(-1.5))); var o = ubjl.Read(); Assert.AreEqual(-1.5, (double)o); }
public void Ubjl_Int8() { var ubjl = new UbjsonReader(new byte[] { 0x69, 0xFF }); var o = ubjl.Read(); Assert.AreEqual((sbyte)-1, (sbyte)o); }
public void Ubjl_Float32() { var ubjl = new UbjsonReader(B(new byte[] { 0x64 }, B(-1.5F))); var o = ubjl.Read(); Assert.AreEqual(-1.5F, (float)o); }
public void Ubjl_Int64() { var ubjl = new UbjsonReader(new byte[] { 0x4C, 0x12, 0x34, 0x56, 0x78, 0xAA, 0xBB, 0xCC, 0xDD }); var o = ubjl.Read(); Assert.AreEqual(0x12345678AABBCCDDL, (long)o); }
public void Ubjl_True() { var ubjl = new UbjsonReader(new byte[] { 0x4E, 0x54 }); Assert.IsTrue((bool)ubjl.Read()); }
public void Ubjl_False() { var ubjl = new UbjsonReader(new byte[] { 0x4E, 0x46, 0x4E, 0x5A }); Assert.IsFalse((bool)ubjl.Read()); }
public void Ubjl_Noops() { var ubjl = new UbjsonReader(new byte[] { 0x4E, 0x4E, 0x4E, 0x5A }); Assert.IsNull(ubjl.Read()); }