Exemple #1
0
 public URLCollectingService(IPageService pageService, IURLParsingService urlParsingService)
 {
     this.pageService       = pageService;
     this.urlParsingService = urlParsingService;
     urlsDict = new Dictionary <string, int>();
     tasks    = new List <Task>();
 }
Exemple #2
0
        public void Initialize()
        {
            List <URL> urls1 = new List <URL>()
            {
                new URL()
                {
                    Url = "/wiki/Microsoft"
                },
                new URL()
                {
                    Url = "/wiki/World_War_II"
                },
                new URL()
                {
                    Url = "/wiki/Xbox"
                }
            };
            List <URL> urls2 = new List <URL>()
            {
                new URL()
                {
                    Url = "/wiki/DirectX"
                },
                new URL()
                {
                    Url = "/wiki/Windows"
                },
                new URL()
                {
                    Url = "/wiki/World_War_I"
                }
            };

            pageService       = Substitute.For <IPageService>();
            urlParsingService = Substitute.For <IURLParsingService>();
            urlParsingService.GetAllURLsFromPage(Arg.Any <string>(), 1).Returns(urls1);
            urlParsingService.GetAllURLsFromPage(Arg.Any <string>(), 2).Returns(urls2);
        }