public WorkstationTopUpStatusResourceBuilder(
     IAuthorisationService authorisationService,
     IWorkstationPack workstationPack)
 {
     this.authorisationService = authorisationService;
     this.workstationPack      = workstationPack;
 }
예제 #2
0
        public void EstablishContext()
        {
            this.WorkstationFacadeService = Substitute.For <IWorkstationFacadeService>();
            this.WorkstationPack          = Substitute.For <IWorkstationPack>();
            this.AuthorisationService     = Substitute.For <IAuthorisationService>();

            var bootstrapper = new ConfigurableBootstrapper(
                with =>
            {
                with.Dependency(this.WorkstationFacadeService);
                with.Dependency <IResourceBuilder <ResponseModel <WorkstationTopUpStatus> > >(
                    new WorkstationTopUpStatusResourceBuilder(this.AuthorisationService, this.WorkstationPack));
                with.Module <WorkstationModule>();
                with.ResponseProcessor <WorkstationTopUpStatusResponseProcessor>();
                with.RequestStartup(
                    (container, pipelines, context) =>
                {
                    var claims = new List <Claim>
                    {
                        new Claim(ClaimTypes.Role, "employee"),
                        new Claim(ClaimTypes.NameIdentifier, "test-user"),
                        new Claim("privilege", "p1")
                    };

                    var user = new ClaimsIdentity(claims, "jwt");

                    context.CurrentUser = new ClaimsPrincipal(user);
                });
            });

            this.Browser = new Browser(bootstrapper);
        }
예제 #3
0
파일: ContextBase.cs 프로젝트: linn/stores
 public void SetUpContext()
 {
     this.PtlRepository             = Substitute.For <ISingleRecordRepository <PtlMaster> >();
     this.TopUpListJobRefRepository = Substitute.For <IRepository <TopUpListJobRef, string> >();
     this.WorkstationPack           = Substitute.For <IWorkstationPack>();
     this.Sut = new WorkstationService(this.PtlRepository, this.TopUpListJobRefRepository, this.WorkstationPack);
 }
예제 #4
0
 public WorkstationService(
     ISingleRecordRepository <PtlMaster> ptlMasterRepository,
     IRepository <TopUpListJobRef, string> topUpListJobRefRepository,
     IWorkstationPack workstationPack)
 {
     this.ptlMasterRepository       = ptlMasterRepository;
     this.topUpListJobRefRepository = topUpListJobRefRepository;
     this.workstationPack           = workstationPack;
 }