예제 #1
0
        public void SetUp()
        {
            this.result = new List <SosAllocDetail> {
                new SosAllocDetail {
                    Id = 1
                }
            };
            this.resource = new AccountOutletRequestResource {
                JobId = 808, AccountId = 21, OutletNumber = 8
            };
            this.AllocationFacadeService.UnpickItems(Arg.Is <AccountOutletRequestResource>(
                                                         a => a.AccountId == this.resource.AccountId &&
                                                         a.OutletNumber == this.resource.OutletNumber &&
                                                         a.JobId == this.resource.JobId))
            .Returns(new SuccessResult <IEnumerable <SosAllocDetail> >(this.result));

            this.Response = this.Browser.Post(
                $"/logistics/allocations/unpick",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.resource);
            }).Result;
        }
예제 #2
0
        public void SetUp()
        {
            this.resource = new AccountOutletRequestResource {
                JobId = 1, AccountId = 2, OutletNumber = 3
            };
            this.AllocationService.UnpickItems(1, 2, 3)
            .Throws(new UnpickItemsException("something"));

            this.results = this.Sut.UnpickItems(this.resource);
        }
예제 #3
0
 public IResult <IEnumerable <SosAllocDetail> > UnpickItems(AccountOutletRequestResource requestResource)
 {
     try
     {
         var items = this.allocationService.UnpickItems(
             requestResource.JobId,
             requestResource.AccountId,
             requestResource.OutletNumber);
         return(new SuccessResult <IEnumerable <SosAllocDetail> >(items));
     }
     catch (UnpickItemsException ex)
     {
         return(new BadRequestResult <IEnumerable <SosAllocDetail> >(ex.Message));
     }
 }
예제 #4
0
        public void SetUp()
        {
            this.resource = new AccountOutletRequestResource {
                JobId = 1, AccountId = 2, OutletNumber = 3
            };
            this.items = new List <SosAllocDetail> {
                new SosAllocDetail {
                    Id = 303
                }
            };

            this.AllocationService.UnpickItems(1, 2, 3)
            .Returns(this.items);

            this.results = this.Sut.UnpickItems(this.resource);
        }