예제 #1
0
        // [ConsoleInput("0")]
        public void csvFileReader_CheckAndReadCsvFile()
        {
            //string test = "0";
            //StreamReader input = new StreamReader(test);
            ////string text = reader.ReadToEnd();
            // // var input = text ;
            //Console.SetIn(input);
            string test = "0";

            byte[]       byteArray = Encoding.ASCII.GetBytes(test);
            MemoryStream stream    = new MemoryStream(byteArray);
            StreamReader reader    = new StreamReader(stream);

            Console.SetIn(reader);

            bool expectedReadTrue = true;
            bool actualReadReturn = CsvFileReader.CheckAndReadCsvFile(_path);

            Assert.Equal(expectedReadTrue, actualReadReturn);

            bool expectedFalseReturn = false;
            bool actualReturn        = CsvFileReader.CheckPathExistOrNot(_path);

            Assert.NotEqual(expectedFalseReturn, actualReturn);
        }