private void validate(string template, IEnumerable <Cell> cells, List <string> keys) { var errors = new ParseErrors(template); keys.ForEach(key => { if (cells.FirstOrDefault(c => c.Key == key) == null) { errors.MarkExtra(key); } }); foreach (Cell cell in cells) { if (!keys.Contains(cell.Key)) { if (cell.IsBooleanResult()) { continue; } errors.MarkMissing(cell.Key); } } errors.ThrowIfErrors(); }
private void validate(string template, IEnumerable<Cell> cells, List<string> keys) { var errors = new ParseErrors(template); keys.ForEach(key => { if (cells.FirstOrDefault(c => c.Key == key) == null) { errors.MarkExtra(key); } }); foreach (Cell cell in cells) { if (!keys.Contains(cell.Key)) { if (cell.IsBooleanResult()) continue; errors.MarkMissing(cell.Key); } } errors.ThrowIfErrors(); }