public void EstablishContext() { this.ExportRsnService = Substitute.For <IExportRsnService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.ExportRsnService); with.Dependency <IResourceBuilder <IEnumerable <ExportRsn> > >(new ExportRsnsResourceBuilder()); with.Module <ExportRsnModule>(); with.ResponseProcessor <ExportRsnsResponseProcessor>(); 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 ExportRsnModule(IExportRsnService exportRsnService) { this.exportRsnService = exportRsnService; this.Get("/inventory/exports/rsns", parameters => this.GetRsns()); }