public void EstablishContext() { this.DeliveryPerfResultFacadeService = Substitute.For<IDeliveryPerfResultFacadeService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.DeliveryPerfResultFacadeService); with.Dependency<IResourceBuilder<ResultsModel>>(new ResultsModelResourceBuilder()); with.Dependency<IResourceBuilder<IEnumerable<ResultsModel>>>( new ResultsModelsResourceBuilder()); with.Module<DeliveryPerformanceModule>(); with.ResponseProcessor<ResultsModelsJsonResponseProcessor>(); with.ResponseProcessor<ResultsModelJsonResponseProcessor>(); with.ResponseProcessor<IEnumerableCsvResponseProcessor>(); with.RequestStartup( (container, pipelines, context) => { var claims = new List<Claim> { new Claim(ClaimTypes.Role, "employee"), new Claim(ClaimTypes.NameIdentifier, "test-user") }; var user = new ClaimsIdentity(claims, "jwt"); context.CurrentUser = new ClaimsPrincipal(user); }); }); this.Browser = new Browser(bootstrapper); }
public DeliveryPerformanceModule(IDeliveryPerfResultFacadeService deliveryPerfResultFacadeService) { this.deliveryPerfResultFacadeService = deliveryPerfResultFacadeService; this.Get("/production/reports/delperf", _ => this.GetDeliveryPerfResult()); this.Get("/production/reports/delperf/details", _ => this.GetDeliveryPerfDetails()); }