Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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
        }
Esempio n. 3
0
        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.
        }