public OutputData Analyze(InputData inputData) { return new OutputData { Rows = Aggregate(inner.Analyze(inputData), inputData) }; }
private IEnumerable<string> GetDataLines(InputData data) { yield return string.Join(",", data.Configuration.GetAllHeaders()); foreach (var row in data.Rows) { yield return string.Join(",", row); } }
private IEnumerable<IEnumerable<string>> Aggregate(OutputData data, InputData inputData) { var groups = ExtractGroupCombinations(inputData.Configuration.GroupVariables.ToList()) .Distinct(comparer) .ToList(); var tables = GetTables(data).ToList(); yield return GetHeaders(groups.SelectMany(g => g.Select(t => t.Name)).Distinct(), tables.First()); for (var i = 0; i < groups.Count; i++) { yield return GetRow(groups[i], tables[i]); } }
public OutputData Analyze(InputData inputData, AnalyzeType analyzeType) { return AnalyzeCommandFactory.CreateCommand(analyzeType, directory).Analyze(inputData); }
public string WriteToFile(InputData data, string filePath) { var lines = GetDataLines(data); return WriteLinesToFile(lines, filePath); }
public AnalyzeDataMessage(InputData inputData, AnalyzeType type) { InputData = inputData; Type = type; }