示例#1
0
        public void SetUp()
        {
            this.allocationResult = new AllocationResult(2934762);

            this.resource = new AllocationOptionsResource
            {
                AccountId                = 111,
                ArticleNumber            = "article",
                StockPoolCode            = "st",
                DespatchLocationCode     = "d",
                ExcludeOnHold            = true,
                ExcludeOverCreditLimit   = true,
                ExcludeUnsuppliableLines = true
            };

            this.AllocationFacadeService.StartAllocation(Arg.Any <AllocationOptionsResource>())
            .Returns(new SuccessResult <AllocationResult>(this.allocationResult));

            this.Response = this.Browser.Post(
                "/logistics/allocations",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.resource);
            }).Result;
        }
示例#2
0
        public IResult <AllocationResult> StartAllocation(AllocationOptionsResource allocationOptionsResource)
        {
            var cutOffDate = !string.IsNullOrWhiteSpace(allocationOptionsResource.CutOffDate)
                                 ? DateTime.Parse(allocationOptionsResource.CutOffDate)
                                 : (DateTime?)null;

            return(new SuccessResult <AllocationResult>(this.allocationService.StartAllocation(
                                                            allocationOptionsResource.StockPoolCode,
                                                            allocationOptionsResource.DespatchLocationCode,
                                                            allocationOptionsResource.AccountId,
                                                            allocationOptionsResource.ArticleNumber,
                                                            allocationOptionsResource.AccountingCompany,
                                                            allocationOptionsResource.CountryCode,
                                                            cutOffDate,
                                                            allocationOptionsResource.ExcludeUnsuppliableLines,
                                                            allocationOptionsResource.ExcludeOnHold,
                                                            allocationOptionsResource.ExcludeOverCreditLimit,
                                                            allocationOptionsResource.ExcludeNorthAmerica,
                                                            allocationOptionsResource.ExcludeEuropeanUnion)));
        }
示例#3
0
        public void SetUp()
        {
            this.startDetails = new AllocationResult(234);
            this.resource     = new AllocationOptionsResource
            {
                StockPoolCode            = "LINN",
                AccountId                = 24,
                ArticleNumber            = "article",
                DespatchLocationCode     = "dispatch",
                AccountingCompany        = "LINN",
                CutOffDate               = 1.July(2021).ToString("o"),
                CountryCode              = null,
                ExcludeOverCreditLimit   = true,
                ExcludeUnsuppliableLines = true,
                ExcludeOnHold            = true,
                ExcludeNorthAmerica      = true,
                ExcludeEuropeanUnion     = true
            };

            this.AllocationService.StartAllocation(
                Arg.Any <string>(),
                Arg.Any <string>(),
                Arg.Any <int>(),
                Arg.Any <string>(),
                Arg.Any <string>(),
                Arg.Any <string>(),
                Arg.Any <DateTime?>(),
                Arg.Any <bool>(),
                Arg.Any <bool>(),
                Arg.Any <bool>(),
                Arg.Any <bool>(),
                Arg.Any <bool>())
            .Returns(this.startDetails);

            this.result = this.Sut.StartAllocation(this.resource);
        }