public void OpenCalledTwice_NoExceptionThrown(CSVReaderWriterForAnnotation.Mode mode, string inputFilePath) { var readerWriter = new CsvReaderWriter(); readerWriter.Open(inputFilePath, mode); readerWriter.Open(inputFilePath, mode); readerWriter.Close(); }
public void Open(string filePath, CSVReaderWriterForAnnotation.Mode mode) { switch (mode) { case CSVReaderWriterForAnnotation.Mode.Read: { csvReader.Open(filePath); return; } case CSVReaderWriterForAnnotation.Mode.Write: { csvWriter.Open(filePath); return; } default: throw new Exception($"Unexected mode {mode.ToString()}. Cannot open file at '{filePath}'"); } }