public void Write_WriteLine_Success()
        {
            // Arrange
            var mockWriter = new Mock<IWriter>();
            using (var readerWriterUnderTest = new CSVReaderWriter(mockWriter.Object))
            {
                // Act
                string[] columns = { "1", "2" };
                readerWriterUnderTest.Write(columns);
            }

            // Assert
            mockWriter.Verify(writer => writer.Write(It.IsAny<string[]>()), Times.Once);
        }
        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 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);
     }
 }