public void FilterHandler_Filter_HeadersImmutable() { var args = new CmdArguments { FilePath = @"..\..\..\Files\Data.tsv", SortByDate = true, Project = 2 }; var result = FilterHandler.Filter(output, args); Assert.AreSame(output.Headers, result.Headers); }
public void FilterHandler_Filter_FilterSuccess() { var args = new CmdArguments { FilePath = @"..\..\..\Files\Data.tsv", SortByDate = false, Project = 2 }; var result = FilterHandler.Filter(output, args); Assert.IsTrue(result.Lines.Count == 1); Assert.IsTrue(result.Lines.First().Project == 2); }
public void FilterHandler_Filter_FilterAndSortNoEffect() { var args = new CmdArguments { FilePath = @"..\..\..\Files\Data.tsv", SortByDate = false, Project = null }; var result = FilterHandler.Filter(output, args); Assert.IsTrue(result.Lines.Count == output.Lines.Count); Assert.IsTrue(result.Lines.First().Project == output.Lines.First().Project); Assert.IsTrue(result.Lines.Last().Project == output.Lines.Last().Project); }
static void Main(string[] args) { try { var arguments = CmdParser.Parse(args); var output = InputParser.Parse(arguments.FilePath); output = FilterHandler.Filter(output, arguments); OutputPrinter.Print(output); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadKey(); } }