Beispiel #1
0
        public void Run_OutputsErrorMessage_NonExistentInputFilePath()
        {
            //Arrange
            string targetPath = @"..\SomeNonExistentPath.csv";
            Dummy_OutputHandler   outputHandler = new Dummy_OutputHandler();
            Dummy_CSVReportReader reportReader  = new Dummy_CSVReportReader();
            IApplication          application   = new Application(outputHandler, new Dummy_SwitchArgs(targetPath), reportReader);
            bool expected = true;

            //Act
            application.Run();
            bool actual = outputHandler.ErrorOutput != string.Empty;


            //Assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void Run_OutputsErrorMessage_NonCSVFilePath()
        {
            //Arrange
            string targetPath = @"..\..\Resources\DUMMY_JSON_REPORT.json";
            Dummy_OutputHandler   outputHandler = new Dummy_OutputHandler();
            Dummy_CSVReportReader reportReader  = new Dummy_CSVReportReader();
            IApplication          application   = new Application(outputHandler, new Dummy_SwitchArgs(targetPath), reportReader);
            bool expected = true;

            //Act
            application.Run();
            bool actual = outputHandler.ErrorOutput != string.Empty;


            //Assert
            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public void Run_SendsStringResult_ValidInput()
        {
            //Arrange
            string targetPath = CSV_SAMPLE_PATH;
            Dummy_ReportContainer container     = new Dummy_ReportContainer(new string[] { "someProp" }, new string[] { "someVal" });
            Dummy_OutputHandler   outputHandler = new Dummy_OutputHandler();
            Dummy_CSVReportReader reportReader  = new Dummy_CSVReportReader(container);

            IApplication application = new Application(outputHandler, new Dummy_SwitchArgs(targetPath), reportReader);
            bool         expected    = true;

            //Act
            application.Run();
            bool actual = outputHandler.Output != string.Empty;


            //Assert
            Assert.AreEqual(expected, actual);
        }