public void StructWithLists() { var mb = MessageBuilder.Create(8); var alloc = mb.Allocator; var ds = new DynamicSerializerState(mb); { ds.SetStruct(0, 2); ds.WriteText(0, "Lorem ipsum"); var los = ds.BuildPointer(1); los.SetListOfStructs(3, 1, 1); var e0 = los.ListBuildStruct(0); e0.WriteData(0, long.MinValue); e0.WriteText(0, long.MinValue.ToString()); var e1 = los.ListBuildStruct(1); e1.WriteData(0, 0L); e1.WriteText(0, 0L.ToString()); var e2 = los.ListBuildStruct(2); e2.WriteData(0, long.MaxValue); e2.WriteText(0, long.MaxValue.ToString()); } { DeserializerState d = ds; Assert.AreEqual(ObjectKind.Struct, d.Kind); Assert.AreEqual("Lorem ipsum", d.ReadText(0)); var los = d.ReadListOfStructs(1, _ => _); Assert.AreEqual(3, los.Count); Assert.AreEqual(long.MinValue, los[0].ReadDataLong(0)); Assert.AreEqual(long.MinValue.ToString(), los[0].ReadText(0)); Assert.AreEqual(0L, los[1].ReadDataLong(0)); Assert.AreEqual(0L.ToString(), los[1].ReadText(0)); Assert.AreEqual(long.MaxValue, los[2].ReadDataLong(0)); Assert.AreEqual(long.MaxValue.ToString(), los[2].ReadText(0)); } }