public async void DeleteAsync_TaskDeleted() { var newGuid = _fixture.Create <Guid>(); var dbTask = _fixture.Create <DbTask>(); _dbRepository.Setup(x => x.GetByIdAsync(newGuid)).Returns(Task.FromResult(dbTask)).Verifiable(); _dbRepository.Setup(x => x.Delete(dbTask)).Verifiable(); await _tasksRepository.DeleteAsync(newGuid); _dbRepository.VerifyAll(); }
public async Task <IActionResult> Delete([FromQuery] int id) { var result = await _tasksRepository.DeleteAsync(id); return(Ok(result)); }