Пример #1
0
        public static VideosController GetInitialisedVideosController(IVideoService videoService)
        {
            var controller = new VideosController(videoService)
            {
                Request = new HttpRequestMessage { RequestUri = new Uri(Url) },
                Configuration = new HttpConfiguration()
            };

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

            return controller;
        }
 public void Setup()
 {
     _videosController =
         ControllerHelper.GetInitialisedVideosController(_mockVideoService.Object);
     AutoMapperConfig.Bootstrap();
 }