示例#1
0
        public void Test_Reading_Duplicate_Entry_Count()
        {
            IListNode listNode = BuildStringListNode(duplicateEntryCount: true);
            int       offset   = 20;

            binaryReader.ReadInt32().Returns(offset, offset);

            int result = listNode.ReadEntryCount(binaryReader);

            result.Should().Be(offset);

            binaryReader.Received(2).ReadInt32();
        }
示例#2
0
        private object ProcessListNode(IBinaryReader binaryReader, IListNode listNode)
        {
            int    count  = listNode.ReadEntryCount(binaryReader);
            uint   offset = listNode.ReadOffset(binaryReader);
            object list   = listNode.CreateList();

            if (count != 0)
            {
                binaryReader.DoAtPosition(offset, () =>
                {
                    for (int n = 0; n < count; ++n)
                    {
                        object entry = ProcessDataNode(binaryReader, listNode.ChildNode);
                        listNode.AddListEntry(list, entry);
                    }
                });
            }

            return(list);
        }