public void EstablishContext() { this.AssemblyFailsReportsFacade = Substitute.For <IAssemblyFailsReportsFacadeService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.AssemblyFailsReportsFacade); with.Dependency <IResourceBuilder <ResultsModel> >(new ResultsModelResourceBuilder()); with.Module <AssemblyFailsReportsModule>(); 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 AssemblyFailsReportsModule(IAssemblyFailsReportsFacadeService reportService) { this.reportService = reportService; this.Get("/production/reports/assembly-fails-waiting-list", _ => this.GetWaitingListReport()); this.Get("/production/reports/assembly-fails-measures/report", _ => this.GetMeasuresReport()); this.Get("/production/reports/assembly-fails-details", _ => this.GetApp()); this.Get("/production/reports/assembly-fails-details/report/export", _ => this.GetDetailsReportExport()); this.Get("/production/reports/assembly-fails-details/report", _ => this.GetDetailsReport()); }