public void Setup()
 {
     _photosController =
         ControllerHelper.GetInitialisedPhotosController(_mockPhotoService.Object);
     AutoMapperConfig.Bootstrap();
 }
Пример #2
0
        public static PhotosController GetInitialisedPhotosController(IPhotoServiceAdvertisingFacade photoService)
        {
            var controller = new PhotosController(photoService)
            {
                Request = new HttpRequestMessage { RequestUri = new Uri(Url) },
                Configuration = new HttpConfiguration()
            };

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

            return controller;
        }