コード例 #1
0
        public void SetUp()
        {
            this.ptlSettings = new PtlSettings {
                BuildToMonthEndFromDays = 1
            };

            this.AuthorisationService.HasPermissionFor(AuthorisedAction.StartTriggerRun, Arg.Any <List <string> >())
            .Returns(true);

            this.result = this.Sut.Build(new ResponseModel <PtlSettings>(this.ptlSettings, new List <string>()));
        }
コード例 #2
0
ファイル: WhenUpdating.cs プロジェクト: lulzzz/production
        public void SetUp()
        {
            this.settings = new PtlSettings();
            this.resource = new PtlSettingsResource
            {
                BuildToMonthEndFromDays      = 1,
                DaysToLookAhead              = 2,
                FinalAssemblyDaysToLookAhead = 3,
                PriorityCutOffDays           = 4,
                PriorityStrategy             = 5,
                SubAssemblyDaysToLookAhead   = 6
            };

            this.PtlSettingsRepository.GetRecord()
            .Returns(this.settings);
            this.result = this.Sut.Update(this.resource);
        }
コード例 #3
0
        public void SetUp()
        {
            var resource = new PtlSettingsResource {
                FinalAssemblyDaysToLookAhead = 5
            };
            var responseModel = new ResponseModel <PtlSettings>(new PtlSettings {
                FinalAssemblyDaysToLookAhead = 5
            }, new List <string>());

            this.AuthorisationService.HasPermissionFor(AuthorisedAction.PtlSettingsUpdate, Arg.Any <List <string> >())
            .Returns(true);
            this.PtlSettingsFacadeService.Update(
                Arg.Is <PtlSettingsResource>(r => r.FinalAssemblyDaysToLookAhead == 5),
                Arg.Any <List <string> >())
            .Returns(new SuccessResult <ResponseModel <PtlSettings> >(responseModel));

            this.Response = this.Browser.Put(
                "/production/maintenance/production-trigger-levels-settings",
                with =>
            {
                with.Header("Accept", "application/json");
                with.JsonBody(resource);
            }).Result;
        }