Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 // 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));
 }