public async Task EmptyInputThrowsException() { //Arrange var message = string.Empty; //Act and Assert await Assert.ThrowsAsync <ArgumentNullException>(() => TextAnalyzerFunction.Run(message, _logger.Object, _luisService.Object, _qnaService.Object, _textAnalyticsService.Object, _queueService.Object)); }
public void ComplicatedQuestionReturnsOther() { //Arrange var message = GeneralUtterances.Qna; var mock = It.Is <LuisResult>(x => x.TopScoringIntent.Intent == "OTHER"); _luisService.Setup(service => service.ExtractEntitiesFromLUIS(message)).ReturnsAsync(mock); //Act TextAnalyzerFunction.Run(message, _logger.Object, _luisService.Object, _qnaService.Object, _textAnalyticsService.Object, _queueService.Object); //Assert //Assert.f }
public void SimpleQuestionReturnsQnA() { //Arrange var message = GeneralUtterances.Qna; //It is not possible to do Mock.Of<LuisResult> var mock = It.Is <LuisResult>(x => x.TopScoringIntent.Intent == "FAQ"); _luisService.Setup(service => service.ExtractEntitiesFromLUIS(message)).ReturnsAsync(mock); //Act TextAnalyzerFunction.Run(message, _logger.Object, _luisService.Object, _qnaService.Object, _textAnalyticsService.Object, _queueService.Object); //Assert //Assert. }