public void GetIndex() { ////Act var result = cmsController.Index(); ////Assert result.Should().BeOfType <ViewResult>(); }
public void Index_ShouldRenderIndexViewWithContent() { const string urlName = "home"; var contents = new List <Content> { new TextContent { UrlName = "home" }, new ActionContent { Name = "Help Pages" } }.AsQueryable(); contentRepository.Expect(cr => cr.GetAll()).Return(contents); cmsController.Index(urlName) .ReturnsViewResult() .ForView("SubPage") .WithModel <CmsViewData>() .AssertAreSame( contents.OfType <ITextContent>().First(), vd => vd.TextContent); }