private void GiveControllerContext() { if (HasAnyController) { if (HasApiController) { if (ApiController.ControllerContext == null) { ApiController.ControllerContext = UmbracoUnitTestHelper.GetApiControllerContext(NeedsHttpRouteData()); } } else if (HasMvcController) { if (Controller.ControllerContext == null) { Controller.ControllerContext = UmbracoUnitTestHelper.GetControllerContext(UmbracoContext, Controller, NeedsPublishedContentRequest(), NeedsRouteData()); } } } }