public async Task CreateQuestion()
        {
            Context
            .Setup(x => x.GetCurrentUserAsync())
            .ReturnsAsync(ModelsCreationHelper.CreateLecturer);

            RepositoryQuestion
            .Setup(x => x.AddAsync(It.Is <DatabaseQuestion>(y => y.Order == int.MaxValue), true))
            .ReturnsAsync(new DatabaseQuestion());

            await ServiceQuestion.CreateQuestionAsync(new Question());
        }
Exemplo n.º 2
0
 public async Task <IActionResult> CreateQuestion([FromBody] Question question)
 {
     return(await Ok(() => _serviceQuestion.CreateQuestionAsync(question)));
 }