public async Task GetQuestion_DataSetNotExists_Exception()
 {
     // Act
     // Assert
     await Assert.ThrowsAnyAsync <UserFriendlyException>(() =>
     {
         return(_appService.GetQuestion(new GetQuestionInput
         {
             DataSetId = Guid.NewGuid(),
             DataSetItemId = Guid.NewGuid()
         }));
     });
 }
Exemple #2
0
        private async Task SetQuestion(PagedResultDto <AnswerLogDto> result)
        {
            var serializerSetting = new JsonSerializerSettings();

            serializerSetting.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            serializerSetting.NullValueHandling     = NullValueHandling.Ignore;
            foreach (var item in result.Items)
            {
                var question = await questionAppService.GetQuestion(new GetQuestionInput { DataSetId = item.DataSetId, DataSetItemId = item.DataSetItemId });

                item.QuestionObject = JsonConvert.SerializeObject(question, serializerSetting);
            }
        }