public void TestStructure(string dataFile, string structureFile) { var subNodes1 = new List<object>(); var nodes2 = StructureParser.Parse(new StreamReader(structureFile).ReadToEnd()); var loader = new Loader(new FileStream(dataFile, FileMode.Open, FileAccess.Read, FileShare.Read)); while (loader.CheckEvent()) { if (loader.CheckEvent<Events.StreamStart, Events.StreamEnd, Events.DocumentStart, Events.DocumentEnd>()) { loader.GetEvent(); continue; } subNodes1.Add(ConvertStructure(loader)); } var nodes1 = subNodes1.Count == 1 ? subNodes1[0] : new EquatableList<object>(subNodes1); Assert.That(nodes1, Is.EqualTo(nodes2)); }