示例#1
0
        public async void AddAsync_TaskAdded()
        {
            var task = _fixture.Create <TaskDomain>();

            _repository.Setup(x => x.AddAsync(task)).Returns(Task.FromResult(false)).Verifiable();
            _unitOfWork.Setup(x => x.SaveChangesAsync()).Returns(Task.FromResult(false)).Verifiable();

            await _taskService.AddAsync(task);

            _repository.VerifyAll();
            _unitOfWork.VerifyAll();
        }
示例#2
0
 public Task <IHttpActionResult> CreateAsync(UZTaskCreationDto dto)
 {
     return(OkOrBadRequest(TaskService.AddAsync(Mapper.Map <UZTaskCreationDto, UZTask>(dto))));
 }