public void CSVFileReader_MultipleCleanups() { FileDataReader reader = new FileDataReader(); string filePath = GetTempFilePath(); reader.Open(filePath); Assert.DoesNotThrow(() => reader.Close()); Assert.DoesNotThrow(() => reader.Close()); }
public void CSVFileReader_DoubleInitialization() { FileDataReader reader = new FileDataReader(); string filePath = GetTempFilePath(); reader.Open(filePath); Assert.Throws <InvalidOperationException>(() => reader.Open(GetTempFilePath())); reader.Close(); }
public void CSVFileReader_SuccessfulMultipleReads_LessData() { string filePath = GetTempFilePath(); WriteData(filePath, "data1"); FileDataReader reader = new FileDataReader(); reader.Open(filePath); Assert.DoesNotThrow(() => reader.ReadLine()); Assert.DoesNotThrow(() => reader.ReadLine()); reader.Close(); }
public void CSVFileReader_SuccessfulRead() { string filePath = GetTempFilePath(); WriteData(filePath, "somedata"); FileDataReader reader = new FileDataReader(); reader.Open(filePath); string dataRead = null; Assert.DoesNotThrow(() => dataRead = reader.ReadLine()); Assert.AreEqual("somedata", dataRead); reader.Close(); }
public void CSVFileReader_CleanupWithoutInitialization() { FileDataReader reader = new FileDataReader(); Assert.DoesNotThrow(() => reader.Close()); }