grrrrinaldi grrrrinaldi - 1 year ago 111
C# Question

Is there a CSV Writer NuGet that uses SystemInterface.IO instead of System.IO?

I started to use CsvHelper by Josh Close, but it uses System.IO.TextWriter, not SystemInterface.IO.
I want to be able to unit test my code without actually creating files.
Does anyone know of a similar helper app that uses SystemInterface.IO?


Answer Source

Since the CsvHelper classes implement interfaces, you can actually mock those

public class CsvReader : ICsvReader
public class CsvWriter : ICsvWriter


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download