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()); }
public async Task <IActionResult> CreateQuestion([FromBody] Question question) { return(await Ok(() => _serviceQuestion.CreateQuestionAsync(question))); }