public void PostCardPaymentTest() { Mock <ITicketRepository> TicketRepo = new Mock <ITicketRepository>(); Mock <IOrderRepository> OrderRepo = new Mock <IOrderRepository>(); HallMovieViewModel hallMovieViewModel = new HallMovieViewModel() { order = new Order() }; var test = new PaymentController(TicketRepo.Object, OrderRepo.Object); test.TempData["hallMovieViewModel"] = new HallMovieViewModel() { order = new Order() }; CardPaymentViewModel model = new CardPaymentViewModel() { CardNumber = "1928374657483920", ExpiryMonth = 3, ExpiryYear = 3000, SecurityNumber = "123" }; model.checkExpired(model.ExpiryMonth, model.ExpiryYear); var result = test.CardPayment(model).ViewName; Assert.AreEqual(result, "Success"); }
public void GetCardPaymentTest() { Mock <ITicketRepository> TicketRepo = new Mock <ITicketRepository>(); Mock <IOrderRepository> OrderRepo = new Mock <IOrderRepository>(); var test = new PaymentController(TicketRepo.Object, OrderRepo.Object); var result = test.CardPayment().ViewName; Assert.AreEqual(result, "CardPayment"); }