예제 #1
0
        public void WhenCalledWithTwoDimensionalIEnumerableThenGiveProperRowAndColumnCountAndAccessValuesRowWiseFromData()
        {
            List <List <String> > testinput = new List <List <string> >
            {
                new List <string> {
                    "Date", "Comment"
                },
                new List <string> {
                    "12/12/2012", "All good"
                },
                new List <string> {
                    "11/11/2011", "Remove duplication"
                },
                new List <string> {
                    "30/11/2015", "Edge Cases not handled"
                }
            };

            MockConsoleOutput mockConsoleOuput = new MockConsoleOutput();

            mockConsoleOuput.WriteOutput(testinput);

            List <List <String> > testoutput = mockConsoleOuput.OutputOnConsole;

            Assert.Equal(4, mockConsoleOuput.n_rows);
            Assert.Equal(2, mockConsoleOuput.n_columns);
            Assert.Equal(testinput, testoutput);
        }
예제 #2
0
        public void TestExpectingAppropriateWriteOutputMethodToBeCalledWhenCalledWithTwoDimensionalIEnumerable()
        {
            string            filepath      = @"D:\a\DummyReviews\DummyReviews\SenderTests\TestSample.csv";
            CSVInput          csvInput      = new CSVInput(filepath);
            MockConsoleOutput consoleOutput = new MockConsoleOutput();
            Controller        controller    = new Controller(csvInput, consoleOutput);
            var parsedinput = (List <List <string> >)controller.ReadInput();

            controller.WriteOutput(parsedinput);
            Assert.Equal("sampledata", consoleOutput.OutputOnConsole[0][0]);
        }