public void TestReadNull() { var reader = new Amf0Reader(); using (var f = new FileStream("../../../../samples/amf0/misc/null.amf0", FileMode.Open)) { var data = new byte[f.Length]; f.Read(data); Assert.IsTrue(reader.TryGetNull(data, out var dataRead, out var consumed)); Assert.AreEqual(null, dataRead); Assert.AreEqual(consumed, f.Length); } }
public void TestNull() { var writer = new Amf0Writer(); var reader = new Amf0Reader(); using (var sc = new SerializationContext()) { writer.WriteNullBytes(sc); var buffer = new byte[sc.MessageLength]; sc.GetMessage(buffer); Assert.IsTrue(reader.TryGetNull(buffer, out var nullObj, out var consunmed)); Assert.IsNull(nullObj); Assert.AreEqual(consunmed, buffer.Length); } }