public void Process(string inputFile)
        {
            var reader = new CSVReaderWriter();
            reader.Open(inputFile, CSVReaderWriter.Mode.Read);

            string column1, column2;

            while(reader.Read(out column1, out column2))
            {
                _mailShot.SendMailShot(column1, column2);
            }

            reader.Close();
        }
        public void Open_CloseOpenedForReadBeforeOpenNew_OpenedWasClosed()
        {
            // Arrange
            var mockReader = new Mock<IReader>();
            #pragma warning disable 618 // obsolete warning
            using (var readerWriterUnderTest = new CSVReaderWriter(mockReader.Object))
            {
                // Act
                readerWriterUnderTest.Open(_testFileForRead, CSVReaderWriter.Mode.Read);
            #pragma warning restore 618

                // Assert
                mockReader.Verify(reader => reader.Close(), Times.Once);
            }
        }
        public void Process(string inputFile)
        {
            var reader = new CSVReaderWriter();
            reader.Open(inputFile, CSVReaderWriter.Mode.Read);
            List<string[]> fileLines = reader.ReadWholeFile();
            reader.Close();

            for (int i = 0; i < fileLines.Count; i++)
            {
                string[] line = fileLines[i];
                _mailShot.SendMailShot(line[0], line[1]);
            }

            reader.Close();
        }
        public void ReadWrite_OpenRealFilesForReadAndWriteForOneInstance_Success()
        {
            // Arrange
            var mockWriter = new Mock<IWriter>();
            #pragma warning disable 618 // obsolete warning
            using (var readerWriterUnderTest = new CSVReaderWriter(mockWriter.Object))

            {
                // Act

                // writing
                string[] columns = { "1", "2" };
                readerWriterUnderTest.Write(columns);

                // reading
                readerWriterUnderTest.Open(_testFileForRead, CSVReaderWriter.Mode.Read);
                var isReadSuccess = readerWriterUnderTest.Read(out columns);

                // Assert
                mockWriter.Verify(writer => writer.Write(It.IsAny<string[]>()), Times.Once);
                Assert.IsTrue(isReadSuccess);
            }

            #pragma warning restore 618
        }
        public void Read_OpenRealFile_Success()
        {
            // Arrange

            #pragma warning disable 618 // obsolete warning
            using (var readerWriterUnderTest = new CSVReaderWriter())
            {
                // Act

                // reading
                readerWriterUnderTest.Open(_testFileForRead, CSVReaderWriter.Mode.Read);
                string[] columns;
                var isReadSuccess = readerWriterUnderTest.Read(out columns);

                // Assert

                Assert.IsTrue(isReadSuccess);
            }

            #pragma warning restore 618
        }