public string GetBasketHtml() { List <Basket> basket = basketRepo.GetItems(); string ret = RenderPartialViewToString("~/Views/Home/BasketView.cshtml", basket); return(ret); }
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); }
public ActionResult GetBasketItems() { return(Json(basketRepo.GetItems(), JsonRequestBehavior.AllowGet)); }