public async Task <IActionResult> DeletePlannedPurchase(long purchaseId) { PlannedPurchaseDTO purchaseToDelete = await plannedPurchaseRepository.GetPlannedPurchaseByIdAsync(purchaseId); if (purchaseToDelete == null) { return(NotFound()); } await plannedPurchaseRepository.DeletePlannedPurchaseAsync(purchaseToDelete); return(Ok()); }
public void DeletePlannedPurchaseAsync_NullParameterThrows() { repository = new PlannedPurchaseRepository(context); Assert.ThrowsAsync <ArgumentNullException>(() => repository.DeletePlannedPurchaseAsync(null)); }