public void LoadFile_ValidFile_Success() { IDataLoader dataLoader = new CSVDataLoader(); var result = dataLoader.Load(".\\IntegrationTests\\Repository\\Test.csv"); Assert.Equal(3, result.Length); }
public BookDetails GetBookDetails() { IDataCacher dataCacher = new MemDataCacher(); if (dataCacher.GetData() == null) { IDataLoader dataLoader = new CSVDataLoader(); BookDetails bookDetails = new BookDetails(); bookDetails = dataLoader.Load(); dataCacher.SetData(bookDetails); return(bookDetails); } else { return(dataCacher.GetData()); } }
public void LoadFile_FileNotExists_ArgumentException() { IDataLoader dataLoader = new CSVDataLoader(); Assert.Throws <ArgumentException>(() => dataLoader.Load(".\\IntegrationTests\\Repository\\DoesNotExists.csv")); }
static void Main(string[] args) { CSVDataLoader load = new CSVDataLoader(); load.Load(); }