예제 #1
0
        public string GetBasketHtml()
        {
            List <Basket> basket = basketRepo.GetItems();
            string        ret    = RenderPartialViewToString("~/Views/Home/BasketView.cshtml", basket);

            return(ret);
        }
예제 #2
0
        public void TestLoadANormalBasket()
        {
            var fileReader = new Mock <IBasketFileReader>();

            fileReader.Setup(x => x.GetTextReader()).Returns(new BasketTestData().GetValidTestData);
            var testRepository = new BasketRepository(fileReader.Object);

            var catalog = testRepository.GetItems().ToList();

            Assert.IsTrue(catalog.Count() == 3);
        }
예제 #3
0
 public ActionResult GetBasketItems()
 {
     return(Json(basketRepo.GetItems(), JsonRequestBehavior.AllowGet));
 }