public void TestReadUndefined() { var reader = new Amf0Reader(); using (var f = new FileStream("../../../../samples/amf0/misc/undefined.amf0", FileMode.Open)) { var data = new byte[f.Length]; f.Read(data); Assert.IsTrue(reader.TryGetUndefined(data, out var dataRead, out var consumed)); Assert.AreEqual(consumed, f.Length); } }
public void TestUndefined() { var writer = new Amf0Writer(); var reader = new Amf0Reader(); using (var sc = new SerializationContext()) { writer.WriteBytes(new Undefined(), sc); var buffer = new byte[sc.MessageLength]; sc.GetMessage(buffer); Assert.IsTrue(reader.TryGetUndefined(buffer, out var ud, out var consunmed)); Assert.IsNotNull(ud); Assert.AreEqual(consunmed, buffer.Length); } }