public CSVReaderWriter() { // This needs to be injected by IoC container but as I didn't wanted to change the signature of the caller class, I didn't pass it through constructor var fileProvider = new FileProvider(); _builder = new CsvReaderWriterBuilder(fileProvider); }
// It's anti-pattern to have two constructors (one with injection and one without) but this is done for the purpose of the mocking for the tests. public CSVReaderWriter(ICsvReaderWriterBuilder builder) { _builder = builder ?? throw new ArgumentNullException(nameof(builder)); }