示例#1
0
 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());
 }
示例#2
0
        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());
        }
示例#3
0
 public void DeleteCreditCard(string cardNumber)
 {
     _creditCardService.DeleteCreditCard(cardNumber);
 }