public void DeleteCreditCardTest() { Assert.AreEqual(2, _creditCardService.GetAllCreditCards().Count()); _creditCardService.AddCreditCard(_creditCard); Assert.AreEqual(3, _creditCardService.GetAllCreditCards().Count()); _creditCardService.DeleteCreditCard(_creditCardService.GetAllCreditCards().Last().CardNumber); Assert.AreEqual(2, _creditCardService.GetAllCreditCards().Count()); }
public ActionResult DeleteCreditCard(int Id) { //if (!ModelState.IsValid) //{ // return BadRequest("Invalid Request"); //} var updateResult = _creditCardService.DeleteCreditCard(Id); if (!string.IsNullOrEmpty(updateResult)) { return(StatusCode((int)HttpStatusCode.NotAcceptable, updateResult)); } return(Ok()); }
public void DeleteCreditCard(string cardNumber) { _creditCardService.DeleteCreditCard(cardNumber); }