Esempio n. 1
0
        public async Task add_async_should_invoke_add_async_on_repository()
        {
            // Arrange
            var scrapService = new ScraperService(_scanPageServiceMock.Object, _adRepository.Object);

            // Act
            await scrapService.ScrapAsync();

            // Assert
            _scanPageServiceMock.Verify(x => x.GetAllAsync(), Times.Once);
        }
Esempio n. 2
0
        private async Task ResumeAfterRateIsSet(
            IDialogContext context,
            IAwaitable <long> argument)
        {
            rating = (int)await argument;
            string message = GetMessageAfterRatingSet(rating);
            await context.SayAsync(message);

            var    scraper      = new ScraperService();
            string scrappedText = await scraper.ScrapAsync(link);

            TextSplitter splitter = new TextSplitter(scrappedText.Trim());

            string[] split         = splitter.Split(MaxDocumentLength);
            var      textAnalytics = new TextAnalyticsApiService();
            var      keywords      = await textAnalytics.GetKeywordsAsync(split);

            await context.PostAsync($"Keywords: {String.Join(",", keywords)}");

            context.Done <object>(null);
        }
Esempio n. 3
0
 private static async Task Execute()
 {
     await _scraperService.ScrapAsync();
 }