public void Initialize() { urlRepository = Substitute.For <IURLRepository>(); urlRepository.GetAllUrls().Returns(new List <URL>() { new URL() { Url = "/wiki/World_War_I", IterationID = 1 } }); }
public void AddURLFromDict(Dictionary <string, int> urls) { var urlsFromDB = urlRepos.GetAllUrls(); foreach (var url in urls) { if (!urlsFromDB.Any(x => x.Url == url.Key)) { var urlEntity = new URL() { Url = url.Key, IterationID = url.Value }; AddURL(urlEntity); urlRepos.SaveChanges(); } } }