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); }
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); }
private static async Task Execute() { await _scraperService.ScrapAsync(); }