示例#1
0
        public void WhenGivenValidLogDataThenWritesAnalysisToOutputFile()
        {
            var inputString = new StringReader("1/1/2020 12:30,Code should be decoupled\nEnd of log file");

            Console.SetIn(inputString);
            ConsoleReader.Main();
            var output = new OutputFileReader();

            Assert.True(output.FileContents == "code,1\r\ndecoupled,1");
        }
示例#2
0
        public void WhenGivenEmptyFileThenWritesDataNotFoundToOutputFile()
        {
            var inputString = new StringReader("End of log file");

            Console.SetIn(inputString);
            ConsoleReader.Main();
            var output = new OutputFileReader();

            Assert.True(output.FileContents == "Data not found");
        }