public void InsertPymentCardTest() { PaymentCardRepository.Insert(paymentCard); var cardFromList = PaymentCardRepository.GetPaymentCardById(paymentCard.Id); Assert.AreEqual(paymentCard, cardFromList); }
public void GetPaymentCardByIdTest() { PaymentCardRepository.Insert(paymentCard); var cardFromList = PaymentCardRepository.GetPaymentCardById(paymentCard.Id); Assert.IsNotNull(cardFromList); }
public void RemovePaymentCardTest() { PaymentCardRepository.Insert(paymentCard); var cardItemFromList = PaymentCardRepository.GetPaymentCardById(paymentCard.Id); PaymentCardRepository.Remove(cardItemFromList); var checkRemovedPaymentCard = PaymentCardRepository.GetPaymentCardById(cardItemFromList.Id); Assert.IsNull(checkRemovedPaymentCard); }
public void UpdatePaymentCardTest() { PaymentCardRepository.Insert(paymentCard); var cardFromList = PaymentCardRepository.GetPaymentCardById(paymentCard.Id); cardFromList.CardName = "Teuta Gashi"; PaymentCardRepository.Update(cardFromList); Assert.Contains(cardFromList, PaymentCardRepository.GetPaymentCards()); }
public void GetInitialPaymentCardsTest() { paymentCardList = PaymentCardRepository.GetPaymentCards(); if (paymentCardList.Count() <= 0) { Assert.IsEmpty(paymentCardList); } else { Assert.IsNotEmpty(paymentCardList); } }
public ActionResult Create(PaymentCard paymentCard) { try { PaymentCardRepository.Insert(paymentCard); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(Order model) { model.CartDetails = HttpContext.Session.Get <List <Cart> >("cartV"); foreach (var detail in model.CartDetails) { model.TotalPrice += detail.StockControl.Product.RetailPrice * detail.Quantity; } OrderRepository.Insert(model); PaymentCardRepository.Insert(model.Payment); return(RedirectToAction(nameof(Index))); }
// GET: PaymentCards public ActionResult Index() { return(View(PaymentCardRepository.GetPaymentCards())); }