public void TestJsonRead() { var jd = new JsonDeserializer(); jd.Options.TagMode = TagMode.Aliases; SamplePerson p = new SamplePerson(); jsonStream.Position = 0; jd.FromStream(p, jsonStream); Assert.AreEqual(person.Name, p.Name); }
public static void Init(TestContext context) { SamplePerson.Counter = 0; Random rnd = new Random(20151125); person = new SamplePerson(rnd, 1); var js = new JsonSerializer(); js.JsonOptions.Indent = ""; js.JsonOptions.FieldSeparator = ""; js.Options.TagMode = TagMode.Aliases; js.ToStream(person, jsonStream); var bs = new BinarySerializer(); bs.ToStream(person, binaryStream); ProtoBuf.Serializer.Serialize(protobufStream, person); }