Exemplo n.º 1
0
        public void EstablishContext()
        {
            this.ProductionMeasuresReportFacade = Substitute.For <IProductionMeasuresReportFacade>();

            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.ProductionMeasuresReportFacade);
                with.Dependency <IResourceBuilder <ProductionMeasures> >(new ProductionMeasuresResourceBuilder());
                with.Dependency <IResourceBuilder <IEnumerable <ProductionMeasures> > >(
                    new ProductionMeasuresListResourceBuilder());
                with.Module <ProductionMeasuresModule>();
                with.ResponseProcessor <ProductionMeasuresResponseProcessor>();
                with.ResponseProcessor <ProductionMeasuresListResponseProcessor>();
                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);
        }
Exemplo n.º 2
0
        public ProductionMeasuresModule(IProductionMeasuresReportFacade productionMeasuresReportFacade)
        {
            this.productionMeasuresReportFacade = productionMeasuresReportFacade;

            this.Get("/production/reports/measures/cits", _ => this.GetProductionMeasuresForCits());
            this.Get("/production/reports/measures/info", _ => this.GetProductionMeasuresInfo());
            this.Get("/production/reports/measures/export", _ => this.GetProductionMeasuresExport());
        }
Exemplo n.º 3
0
        public ProductionMeasuresModule(IProductionMeasuresReportFacade productionMeasuresReportFacade)
        {
            this.productionMeasuresReportFacade = productionMeasuresReportFacade;

            this.Get("/production/reports/measures/cits", _ => this.GetProductionMeasuresForCits());
            this.Get("/production/reports/measures/info", _ => this.GetProductionMeasuresInfo());
            this.Get("/production/reports/measures/export", _ => this.GetProductionMeasuresExport());
            this.Get("/production/reports/failed-parts", _ => this.GetFailedPartsReport());
            this.Get("/production/reports/days-required", _ => this.GetDaysRequiredReport());
        }