Ejemplo n.º 1
0
 public static StringBuilder AddStatistics(this StringBuilder report, BulkSolutionsAnalysisRun analysisRun) =>
 report
 .AddStatisticsHeader()
 .AddStatisticsForStatus(analysisRun.Approved, "Approve")
 .AddStatisticsForStatus(analysisRun.Disapproved, "Disapprove")
 .AddStatisticsForStatus(analysisRun.ReferredToMentor, "Refer to mentor")
 .AddStatisticsForStatus(analysisRun.All, "Total");
 private static string Create(BulkSolutionsAnalysisRun analysisRun) =>
 new StringBuilder()
 .AddHeader()
 .AppendLine()
 .AddGeneralInfo(analysisRun)
 .AppendLine()
 .AddStatistics(analysisRun)
 .AppendLine()
 .AddComments(analysisRun)
 .ToString();
Ejemplo n.º 3
0
        public static void Write(BulkSolutionsAnalysisRun analysisRun)
        {
            using (var fileWriter = File.CreateText(Path.Combine(analysisRun.Options.Directory, "bulk_analysis.json")))
                using (var jsonTextWriter = new JsonTextWriter(fileWriter))
                {
                    jsonTextWriter.Formatting = Formatting.Indented;

                    var analysisRunJObject = CreateAnalysisRunJObject(analysisRun);
                    analysisRunJObject.WriteTo(jsonTextWriter);
                }
        }
 public static void Write(BulkSolutionsAnalysisRun analysisRun)
 {
     using var fileStream     = File.Create(Path.Combine(analysisRun.Options.Directory, "bulk_analysis.json"));
     using var jsonTextWriter = new Utf8JsonWriter(fileStream, new JsonWriterOptions { Indented = true });
     JsonSerializer.Serialize(jsonTextWriter, analysisRun);
 }
Ejemplo n.º 5
0
 public static StringBuilder AddGeneralInfo(this StringBuilder report, BulkSolutionsAnalysisRun analysisRun) =>
 report
 .AddGeneralInfoHeader()
 .AppendLine($"{"Slug",GeneralInfoColumnWidth}: {analysisRun.Options.Slug}")
 .AppendLine($"{"Directory",GeneralInfoColumnWidth}: {analysisRun.Options.Directory}");
Ejemplo n.º 6
0
 private static JObject CreateAnalysisRunJObject(BulkSolutionsAnalysisRun analysisRun) =>
 JObject.FromObject(analysisRun, CreateJsonSerializer());
 public static void Output(BulkSolutionsAnalysisRun analysisRun) =>
 Console.WriteLine(Create(analysisRun));
Ejemplo n.º 8
0
 public static StringBuilder AddComments(this StringBuilder report, BulkSolutionsAnalysisRun analysisRun) =>
 report
 .AddCommentsHeader()
 .AddCommentsForStatus(analysisRun.Approved, "Approve")
 .AddCommentsForStatus(analysisRun.Disapproved, "Disapprove")
 .AddCommentsForStatus(analysisRun.All, "Total");