public void Setup()
 {
     _propertiesController =
         ControllerHelper.GetInitialisedPropertiesController(_mockPropertyService.Object);
     AutoMapperConfig.Bootstrap();
 }
Ejemplo n.º 2
0
        public static PropertiesController GetInitialisedPropertiesController(IPropertyService propertyService)
        {
            var controller = new PropertiesController(propertyService)
            {
                Request = new HttpRequestMessage { RequestUri = new Uri(Url) },
                Configuration = new HttpConfiguration()
            };

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

            return controller;
        }