public SpecSuite Add(SpecCategory category) { _categories.Add(category); return this; }
public void AddRange(SpecCategory[] categories) { foreach (var specCategory in categories) Add(specCategory); }
private SpecSuite processSuite(Func<SpecificationMethodInfo, SpecInfo> processor, params Assembly[] assemblies) { var suite = new SpecSuite(); var specs = assemblies .SelectMany(getSpecs) .Select(x => new { Category = x.Specification.SpecificationCategory, SpecInfo = processor(x) }) .GroupBy(x => x.Category) .Select(group => { var category = new SpecCategory(group.Key); foreach (var g in group) category.Add(g.SpecInfo); return category; }).ToArray(); suite.AddRange(specs); return suite; }