public async Task <IActionResult> DeletePlannedPurchase(long purchaseId)
        {
            PlannedPurchaseDTO purchaseToDelete = await plannedPurchaseRepository.GetPlannedPurchaseByIdAsync(purchaseId);

            if (purchaseToDelete == null)
            {
                return(NotFound());
            }

            await plannedPurchaseRepository.DeletePlannedPurchaseAsync(purchaseToDelete);

            return(Ok());
        }
Example #2
0
        public void DeletePlannedPurchaseAsync_NullParameterThrows()
        {
            repository = new PlannedPurchaseRepository(context);

            Assert.ThrowsAsync <ArgumentNullException>(() => repository.DeletePlannedPurchaseAsync(null));
        }