Example #1
0
 public async void CreateQuizInvalidValue(CreateQuizRequestModel model)
 {
     model.Name = "name";
     await Assert.ThrowsAsync <Exception>(async() =>
     {
         await _service.Create(model);
     });
 }
Example #2
0
        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)));
        }
Example #3
0
 public async Task <int> Create(CreateQuizRequestModel model)
 {
     return(await _quiz.Create(model));
 }