public async void CreateQuizInvalidValue(CreateQuizRequestModel model) { model.Name = "name"; await Assert.ThrowsAsync <Exception>(async() => { await _service.Create(model); }); }
public async Task <int> Create(CreateQuizRequestModel model) { if (_quizRepo.CheckIfQuizExisting(model.Name)) { throw new Exception("Duplicated Quiz Name"); } return(await _quizRepo.Create(_mapper.Map <Quiz>(model))); }
public async Task <int> Create(CreateQuizRequestModel model) { return(await _quiz.Create(model)); }