public void GetProperties_ReturnsIReportContainer_GivenValidInput()
        {
            //Arrange
            string[]         props           = { "someProp" };
            string[]         vals            = { "someVal" };
            IReportContainer reportContainer = new Dummy_ReportContainer(props, vals);
            CSVReportReader  reportReader    = new CSVReportReader(reportContainer, new Dummy_UniqueNameProvider());

            reportReader.Read(_csvText);

            //Act
            IReportContainer actual = reportReader.GetProperties();

            //Assert
            Assert.IsNotNull(actual);
        }
        public void GetProperties_CreatesReportContainer_GivenInvalidInput()
        {
            //Arrange
            string[]         props           = { "" };
            string[]         vals            = { "" };
            IReportContainer reportContainer = new Dummy_ReportContainer(props, vals);
            CSVReportReader  reportReader    = new CSVReportReader(null, new Dummy_UniqueNameProvider());

            reportReader.Read("");

            //Act
            IReportContainer actual = reportReader.GetProperties();

            //Assert
            Assert.IsNotNull(actual);
        }
Пример #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);
        }