/// <summary> /// Deletes an expense report /// </summary> public Task DeleteExpenseAsync(Assignment assignment, Expense expense) { return(service.DeleteExpenseAsync(expense) .ContinueWith(t => { expenses.Remove(expense); CalculateExpenses(assignment); })); }
public void DeleteExpense() { var expense = new Expense(); expense.Description = "New Description"; var saveTask = service.SaveExpenseAsync(expense, CancellationToken.None); saveTask.Wait(); var deleteTask = service.DeleteExpenseAsync(expense, CancellationToken.None); deleteTask.Wait(); Assert.That(deleteTask.Result, Is.EqualTo(1)); }