Пример #1
0
 public void Initialize()
 {
     urlRepository = Substitute.For <IURLRepository>();
     urlRepository.GetAllUrls().Returns(new List <URL>()
     {
         new URL()
         {
             Url = "/wiki/World_War_I", IterationID = 1
         }
     });
 }
Пример #2
0
        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();
                }
            }
        }