コード例 #1
0
 public BuildsByDepartmentReportModule(IBuildsByDepartmentReportFacadeService service)
 {
     this.service = service;
     this.Get("/production/reports/builds-summary", _ => this.GetBuildsSummary());
     this.Get("/production/reports/builds-detail", _ => this.GetBuildsDetail());
     this.Get("/production/reports/builds-detail/export", _ => this.GetBuildsDetailExport());
 }
コード例 #2
0
ファイル: ContextBase.cs プロジェクト: lulzzz/production
        public void EstablishContext()
        {
            this.BuildsByDepartmentReportFacadeService = Substitute.For <IBuildsByDepartmentReportFacadeService>();

            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.BuildsByDepartmentReportFacadeService);
                with.Dependency <IResourceBuilder <ResultsModel> >(new ResultsModelResourceBuilder());
                with.Dependency <IResourceBuilder <IEnumerable <ResultsModel> > >(
                    new ResultsModelsResourceBuilder());
                with.Module <BuildsByDepartmentReportModule>();

                with.ResponseProcessor <ResultsModelsJsonResponseProcessor>();
                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);
        }