示例#1
0
        public async Task FindByTypeAndOrderNumberAsync()
        {
            await _botQuestionRepository.AddQuestionAsync(question);

            var responseQuestion = await _botQuestionRepository.FindByTypeAndOrderNumberAsync(1, 2);

            Assert.Equal(responseQuestion.QuestionStatement, question.QuestionStatement);
        }
        /// <summary>
        /// Method to get the next question of task mail by previous question order
        /// </summary>
        /// <param name="previousQuestionOrder">previous question order</param>
        /// <returns>question</returns>
        private async Task <Question> NextQuestionForTaskMailAsync(QuestionOrder previousQuestionOrder)
        {
            _logger.Info("Task mail module NextQuestionForTaskMailAsync start");
            var orderValue = (int)previousQuestionOrder;
            var typeValue  = (int)BotQuestionType.TaskMail;

            orderValue++;
            // getting question by order number and question type as task mail
            var nextQuestion = await _botQuestionRepository.FindByTypeAndOrderNumberAsync(orderValue, typeValue);

            _logger.Info("Task mail module NextQuestionForTaskMailAsync end");
            return(nextQuestion);
        }