public async Task TaskService_DeleteTaskWhenTaskIsRemoved_ThrowsNoDatabaseObjectFoundException() { _dbContext.Remove(_task); await _dbContext.SaveChangesAsync(); var taskService = new TaskService(_dbContext); Assert.ThrowsAsync <NoDatabaseObjectFoundException>(() => taskService.DeleteTaskAsync(_task.Id, null)); }
public async Task RemoveAsync <TEntity>(TEntity entity) where TEntity : class { _context.Remove(entity); await _context.SaveChangesAsync(); }