public void ToDataRecords_GivenNoCsvContent_GenerateEmptyRecord()
        {
            var csvContent = new string[0];

            CreateTemporaryCsvFileWith(csvContent);

            var sut = new CsvFileConverter();
            List<DataRecord> actualRecords = sut.ToDataRecords(CSV_FILE_NAME);

            Assert.That(actualRecords.Any(), Is.False, "data records has no elements");
        }
        public void ToDataRecords_GivenTwoLinesOfCsvContent_GenerateTwoDataRecord()
        {
            var csvContent = new[] { "Field1;Field2;Field3", "Field1;Field2;Field3" };

            CreateTemporaryCsvFileWith(csvContent);

            var sut = new CsvFileConverter();
            List<DataRecord> actualRecords = sut.ToDataRecords(CSV_FILE_NAME);

            List<DataRecord> expectedRecords = CreateExpectedRecords(howMany: 2);

            Assert.That(actualRecords, Is.EqualTo(expectedRecords), "data records");
        }
        public static void Main(string[] args)
        {
            List<DataRecord> dataRecords = new CsvFileConverter().ToDataRecords(args[FILE_NAME]);

            var userCommands = new CsvUserCommands(
                new ConsoleDisplay(),
                new Table(
                    dataRecords,
                    defaultPageSize: new PageSizeAgent(
                        defaultPageSize: 3,
                        indexOfPageSize: 1).DetectPageSize(args)));

            var csvViewer = new CsvViewer(
                new ConsoleUser(user, userCommands),
                userCommands);

            csvViewer.Execute();
        }