public void GetChildMapWhenParentIsMappedBeforeIt() { var parentMap = new ParentMap(); var childMap = new ChildMap(); var c = new CsvClassMapCollection(); c.Add(parentMap); c.Add(childMap); var map = c[typeof(Child)]; Assert.AreEqual(childMap, map); }
public void GetChildMapWhenParentIsMappedBeforeIt() { var parentMap = new ParentMap(); var childMap = new ChildMap(); var c = new ClassMapCollection(new CsvHelper.Configuration.CsvConfiguration(CultureInfo.InvariantCulture)); c.Add(parentMap); c.Add(childMap); var map = c[typeof(Child)]; Assert.AreEqual(childMap, map); }
public void AddChild(AstNode node) { if (children == null) { children = new ChildMap(); } if (!children.TryGetValue(node.token, out var lst)) { lst = new List <AstNode>(); children.Add(node.token, lst); } lst.Add(node); }