public static CertificatesController GetInitialisedCertificatesController(ICertificateService certificateService) { var controller = new CertificatesController(certificateService) { Request = new HttpRequestMessage { RequestUri = new Uri(Url) }, Configuration = new HttpConfiguration() }; controller.Configuration.MapHttpAttributeRoutes(); controller.Configuration.EnsureInitialized(); return controller; }
public void Setup() { _certificateController = ControllerHelper.GetInitialisedCertificatesController(_mockCertificateService.Object); AutoMapperConfig.Bootstrap(); }