public void CanMapAndSaveResultCollectionToDb() { var products = new ResultCollection <ResultItemCollection> { new ResultItemCollection { Items = new List <ResultItem> { new ResultItem { Name = "ProductName", Value = "Safeguard" }, new ResultItem { Name = "Url", Value = "http://safeguard.com" }, new ResultItem { Name = "Price", Value = "35" }, new ResultItem { Name = "Image", Value = "Safeguard Image 1", IsMultiple = true }, new ResultItem { Name = "Image", Value = "Safeguard Image 2", IsMultiple = true } }, Key = "Safeguard" }, new ResultItemCollection { Items = new List <ResultItem> { new ResultItem { Name = "ProductName", Value = "Vaseline" }, new ResultItem { Name = "Url", Value = "http://vaseline.com" }, new ResultItem { Name = "Price", Value = "105" }, new ResultItem { Name = "Image", Value = "Vaseline Image 1", IsMultiple = true }, new ResultItem { Name = "Image", Value = "Vaseline Image 2", IsMultiple = true }, new ResultItem { Name = "ColourSwatch", Value = "Yellow", IsMultiple = true } }, Key = "Vaseline" } }; var resultCollectionService = new ResultCollectionService(new ColumnDefinitionRepository(), new ScrappedDataRepository(), new SettingRepository()); resultCollectionService.SaveScrappedData(products); }
public void RecreateTables() { var resultCollectionService = new ResultCollectionService(new ColumnDefinitionRepository(), new ScrappedDataRepository(), new SettingRepository()); resultCollectionService.SaveScrappedData(null); }