public void EstablishContext() { this.SalesOutletService = Substitute.For <ISalesOutletService>(); var bootstrapper = new ConfigurableBootstrapper( with => { with.Dependency(this.SalesOutletService); with.Dependency <IResourceBuilder <IEnumerable <SalesOutlet> > >(new SalesOutletsResourceBuilder()); with.Module <SalesOutletModule>(); with.ResponseProcessor <SalesOutletsResponseProcessor>(); 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 SalesOutletModule(ISalesOutletService salesOutletService) { this.salesOutletService = salesOutletService; this.Get("/inventory/sales-outlets", parameters => this.GetSalesOutlets()); }