public void Write_WriteDisposed_ThrowException() { // Arrange var mockWriter = new Mock<IWriter>(); using (var readerWriterUnderTest = new CSVReaderWriter(mockWriter.Object)) { // Act string[] columns = { "1", "2" }; readerWriterUnderTest.Dispose(); readerWriterUnderTest.Write(columns); } }
public void Read_ReadDisposed_ThrowException() { // Arrange var columnsInLines = new List<string[]> { new [] {"1", "2"}, new [] {"3", "4"}, }; var mockReader = CreateMockReader(columnsInLines); using (var readerWriterUnderTest = new CSVReaderWriter(mockReader.Object)) { // Act string[] columns; readerWriterUnderTest.Read(out columns); readerWriterUnderTest.Dispose(); readerWriterUnderTest.Read(out columns); } }