public void EstablishContext() { this.OrdersReportsFacadeService = Substitute.For <IOrdersReportsFacadeService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.OrdersReportsFacadeService); with.Dependency <IResourceBuilder <ManufacturingCommitDateResults> >(new ManufacturingCommitDateResourceBuilder()); with.Dependency <IResourceBuilder <ResultsModel> >(new ResultsModelResourceBuilder()); with.Dependency <IResourceBuilder <IEnumerable <ResultsModel> > >( new ResultsModelsResourceBuilder()); with.Module <OrdersReportsModule>(); with.ResponseProcessor <ManufacturingCommitDateJsonResponseProcessor>(); with.ResponseProcessor <ResultsModelsJsonResponseProcessor>(); with.ResponseProcessor <ResultsModelJsonResponseProcessor>(); 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 OrdersReportsModule(IOrdersReportsFacadeService reportService) { this.reportService = reportService; this.Get("/production/reports/manufacturing-commit-date/report", _ => this.ManufacturingCommitDateReport()); this.Get("/production/reports/manufacturing-commit-date", _ => this.ManufacturingCommitDateReportOptions()); this.Get("/production/reports/overdue-orders/report", _ => this.OverdueOrdersReport()); this.Get("/production/reports/overdue-orders", _ => this.OverdueOrdersReportOptions()); this.Get("/production/reports/production-back-orders", _ => this.ProductionBackOrdersReport()); }