private void AssertReturnsTrueOrThrowsException(ICsvReaderWriter csvReaderWriter) { // Arrange const string dataFile = @"test_data\contacts.csv"; var lineCount = File.ReadAllLines(dataFile).Length; csvReaderWriter.Open(dataFile, CSVReaderWriterForAnnotation.Mode.Read); // Act and Assert for (var i = 0; i < lineCount; i++) { Assert.AreEqual(true, csvReaderWriter.Read("", "")); } Assert.Throws <NullReferenceException>(() => csvReaderWriter.Read("", "")); }
public void Process(string inputFile) { using (_csvReaderWriter) { _csvReaderWriter.Open(inputFile, CSVReaderWriter.Mode.Read); string column1, column2; while (_csvReaderWriter.Read(out column1, out column2)) { _mailShot.SendMailShot(column1, column2); } } }