Exemplo n.º 1
0
 public void AssertCsvString()
 {
     var percentageReport =
         new SubReport
             {
                 Header = "Groffe",
                 GroupedData = new[] {new GroupData {Description = "1", AllGroupsCount = 100, GroupCount = 1}}
                 //KeyValuePair<double, string>(1, "1")}
             };
     var e = new Report {ReportHeader = "Gryffe"};
     e.Add(percentageReport);
     var expected = "Gryffe\t\t\t\t\t\r\n\tGroffe\t100\t\t\t\r\n\t\t\t1\t1\tINF"; //Infinity
     var actual = string.Join(ReportBuilder.CrLf, e.ToCsvReport().ToArray());
     Assert.AreEqual(expected, actual);
 }
Exemplo n.º 2
0
 public void Add(SubReport subReport)
 {
     _percentageReports.Add(subReport);
 }
Exemplo n.º 3
0
 private static Report BuildMyReport(string header,
     IEnumerable<KeyValuePair<string, IEnumerable<Respondent>>>
     groupedRespondents,
     Func<IEnumerable<Respondent>, IEnumerable<GroupData>>
     grouper)
 {
     var report =
         new Report {ReportHeader = header};
     foreach (var respondents in groupedRespondents)
     {
         var percentageReport =
             new SubReport
                 {
                     Header = respondents.Key,
                     GroupedData = grouper(respondents.Value)
                 };
         report.Add(percentageReport);
     }
     return report;
 }