Beispiel #1
0
        public async Task FindByQuestionTypeAsync()
        {
            await _botQuestionRepository.AddQuestionAsync(question);

            var responseQuestion = await _botQuestionRepository.FindFirstQuestionByTypeAsync(BotQuestionType.TaskMail);

            Assert.Equal(DateTime.UtcNow.Date, responseQuestion.CreatedOn.Date);
        }
        /// <summary>
        /// Add task mail details
        /// </summary>
        /// <param name="taskMailId">task mail Id</param>
        /// <returns>first question statement</returns>
        private async Task <string> AddTaskMailDetailAndGetQuestionStatementAsync(int taskMailId)
        {
            _logger.Info("Task mail module add task mail details start");
            TaskMailDetails taskMailDetails = new TaskMailDetails();
            // getting first question of task mail type
            var firstQuestion = await _botQuestionRepository.FindFirstQuestionByTypeAsync(BotQuestionType.TaskMail);

            taskMailDetails.TaskId     = taskMailId;
            taskMailDetails.QuestionId = firstQuestion.Id;
            _taskMailDetailRepository.Insert(taskMailDetails);
            await _taskMailDetailRepository.SaveChangesAsync();

            _logger.Info("Task mail module add task mail details end");
            return(firstQuestion.QuestionStatement);
        }