public void EstablishContext() { this.SmtReportsFacade = Substitute.For <ISmtReportsFacadeService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.SmtReportsFacade); with.Dependency <IResourceBuilder <ResultsModel> >(new ResultsModelResourceBuilder()); with.Module <SmtReportsModule>(); 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 SmtReportsModule(ISmtReportsFacadeService reportService) { this.reportService = reportService; this.Get("/production/reports/smt/outstanding-works-order-parts/report", _ => this.GetOutstandingWorksOrderParts()); }