public void Deserialize() { var formatter = new EnumFormatterInt32 <Target>(new MessagePackProvider(), MessagePackContext.Empty); var reader = new MessagePackReader(new byte[] { 0 }); Target target = formatter.Deserialize(ref reader); Assert.AreEqual(Target.Value, target); Assert.Pass(reader.Print()); }
public void Print() { var reader = new MessagePackReader(new byte[] { 195, 10 }); reader.ReadBoolean(); reader.ReadInt32(); string actual = reader.Print(); string expected = "[195, 10]"; Assert.AreEqual(expected, actual); }
public void DeserializeAsObject() { IMessagePackFormatter formatter = new MessagePackFormatterWrapper <Target>(new MessagePackProvider(), MessagePackContext.Empty, new Formatter(), BuiltinResolver.Instance); var reader = new MessagePackReader(new byte[] { 195, 10 }); var target = formatter.Deserialize(ref reader) as Target; Assert.NotNull(target); Assert.AreEqual(true, target.BoolValue); Assert.AreEqual(10, target.IntValue); Assert.AreEqual(2, reader.Position); Assert.Pass(reader.Print()); }
public void Deserialize() { var formatter = new Formatter(new MessagePackProvider(), MessagePackContext.Empty); var reader = new MessagePackReader(new byte[] { 195, 10 }); Target target = formatter.Deserialize(ref reader); Assert.NotNull(target); Assert.AreEqual(true, target.BoolValue); Assert.AreEqual(10, target.IntValue); Assert.AreEqual(2, reader.Position); Assert.Pass(reader.Print()); }