public void Home_Index_SetResult_Success() { HomeController controller = new HomeController(mock); ViewResult result = controller.Index() as ViewResult; List<ItemPostingViewModel> postings = (List<ItemPostingViewModel>)result.Model; Assert.IsTrue(postings.Count == 3); }
public void Home_Edit_SetViewName_Success() { HomeController controller = new HomeController(mock); int existentId = 5; PartialViewResult result = (PartialViewResult)controller.Edit(existentId); Assert.IsTrue(result.ViewName == "_itemDisplay"); }
public void Home_Edit_SetMode_Success() { HomeController controller = new HomeController(mock); int existentId = 5; PartialViewResult result = (PartialViewResult)controller.Edit(existentId); string mode = result.ViewData["Mode"].ToString(); Assert.IsTrue(mode == "_itemDisplay"); }
public void Home_Edit_SetBlurb_Success() { HomeController controller = new HomeController(mock); int existentId = 5; PartialViewResult result = (PartialViewResult)controller.Edit(existentId); string blurb = result.ViewData["Blurb"].ToString(); Assert.IsTrue(blurb == "This is Shop Text"); }
public void Home_Edit_CallServiceEdit_Success() { HomeController controller = new HomeController(mock); int existentId = 5; PartialViewResult result = (PartialViewResult)controller.Edit(existentId); List<ItemPostingViewModel> postings = (List<ItemPostingViewModel>)result.Model; Assert.IsTrue(postings.Find(x => x.ItemPosting.Id == existentId).Editing); }
public void Home_Index_SetViewBag_Success() { HomeController controller = new HomeController(mock); ViewResult result = controller.Index() as ViewResult; Assert.IsTrue(result.ViewBag.Mode == "_itemDisplay"); }
public void Home_Index_SetResultNotNull_Success() { HomeController controller = new HomeController(mock); ViewResult result = controller.Index() as ViewResult; Assert.IsNotNull(result); }