protected override void ProcessRecord() { List <Test> testList = Markdown.ToClass(Path); DataSerializer.Serialize <List <Test> >(testList, Console.Out, DataType); foreach (Test test in testList) { } //Markdown.ConsoleOut(Path, DataType); //List<Test> testtest = Markdown.ToClass(Path); //Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(testtest, Newtonsoft.Json.Formatting.Indented)); /* * List<TestResult> resultList = new List<TestResult>(); * foreach (Test test in Markdown.ToClass(Path)) * { * test.Run(resultList, Environment.UserName); * //resultList.AddRange(test.Run(Environment.UserName)); * } * * //Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(resultList, Newtonsoft.Json.Formatting.Indented)); * * using (StringWriter sw = new StringWriter()) * using (CsvWriter cw = new CsvWriter(sw)) * { * cw.Configuration.HasHeaderRecord = true; * cw.Configuration.RegisterClassMap<TestResultMapper>(); * cw.WriteRecords(resultList); * * Console.WriteLine(sw.ToString()); * * } */ }
public static void ConsoleOut(string markdownFileOrDirectory, string extension) { DataSerializer.Serialize <List <Test> >(ToClass(markdownFileOrDirectory), Console.Out, extension); }