public void Setup()
 {
     _propertyDetailsController =
         ControllerHelper.GetInitialisedPropertyDetailsController(_mockPropertyDetailsService.Object);
     AutoMapperConfig.Bootstrap();
 }
        public static PropertyDetailsController GetInitialisedPropertyDetailsController(IPropertyDetailServiceAdvertisingFacade propertyDetailService)
        {
            var controller = new PropertyDetailsController(propertyDetailService)
            {
                Request = new HttpRequestMessage { RequestUri = new Uri(Url) },
                Configuration = new HttpConfiguration()
            };

            controller.Configuration.MapHttpAttributeRoutes();
            controller.Configuration.EnsureInitialized();

            return controller;
        }