public void LocationControllerTest_ReturnsPageEditorErrorIfNoLocation() { var repository = Mock.Of<ISitecoreRepository>(); var pageContext = Mock.Of<IPageContext>(pc => pc.IsPageEditor == true); var rendering = Mock.Of<IRenderingWrapper>(); var renderingContext = Mock.Of<IRenderingContext>(rc => rc.Rendering == rendering); LocationDomain domain = new LocationDomain(repository); LocationController locationController = new LocationController(domain, pageContext, renderingContext); var result = locationController.Featured() as ViewResult; Assert.AreEqual("~/Views/Shared/_NoDatasource.cshtml", result.ViewName); }
public void LocationControllerTest_ReturnsEmptyIfNoLocation() { var repository = Mock.Of<ISitecoreRepository>(); var pageContext = Mock.Of<IPageContext>(); var rendering = Mock.Of<IRenderingWrapper>(); var renderingContext = Mock.Of<IRenderingContext>(rc => rc.Rendering == rendering); LocationDomain domain = new LocationDomain(repository); LocationController locationController = new LocationController(domain, pageContext, renderingContext); var result = locationController.Featured(); Assert.AreEqual("EmptyResult", result.GetType().Name); }