Ejemplo n.º 1
0
        public void SetUp()
        {
            this.consignmentId   = 4358;
            this.newCarrier      = "Careful";
            this.requestResource = new ConsignmentUpdateResource {
                Carrier = this.newCarrier
            };
            var consignment = new Consignment {
                ConsignmentId = this.consignmentId
            };

            this.ConsignmentFacadeService.Update(this.consignmentId, Arg.Any <ConsignmentUpdateResource>())
            .Returns(new SuccessResult <Consignment>(consignment));

            this.Response = this.Browser.Put(
                $"logistics/consignments/{this.consignmentId}",
                with =>
            {
                with.Header("Accept", "application/json");
                with.Header("Content-Type", "application/json");
                with.JsonBody(this.requestResource);
            }).Result;
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            this.consignmentId             = 493574354;
            this.newCarrierCode            = "Careful";
            this.newHubId                  = 2533;
            this.newShippingMethod         = "Air";
            this.newTerms                  = "C3PO";
            this.newDespatchLocationCode   = "Linn";
            this.newCustomsEntryCodePrefix = "PP";
            this.newCustomsEntryCode       = "ENTRY";
            this.newCustomsEntryCodeDate   = 1.February(2030).ToString("o");

            var consignment = new Consignment
            {
                ConsignmentId        = this.consignmentId,
                HubId                = 1,
                Carrier              = "Clumsy",
                Terms                = "R2D2",
                ShippingMethod       = "Throw",
                DespatchLocationCode = "MoonBase Alpha",
                Pallets              = new List <ConsignmentPallet>
                {
                    new ConsignmentPallet
                    {
                        PalletNumber = 1, Depth = 0, Height = 0, Weight = 0, Width = 0
                    },
                    new ConsignmentPallet
                    {
                        PalletNumber = 12, Depth = 0, Height = 0, Weight = 0, Width = 0
                    },
                },
                Items = new List <ConsignmentItem>
                {
                    new ConsignmentItem
                    {
                        ItemNumber = 1, Depth = 0, Height = 0, Weight = 0, Width = 0
                    },
                    new ConsignmentItem
                    {
                        ItemNumber = 12, Depth = 0, Height = 0, Weight = 0, Width = 0
                    },
                }
            };

            this.updateResource = new ConsignmentUpdateResource
            {
                HubId                  = this.newHubId,
                Carrier                = this.newCarrierCode,
                ShippingMethod         = this.newShippingMethod,
                Terms                  = this.newTerms,
                DespatchLocationCode   = this.newDespatchLocationCode,
                CustomsEntryCodePrefix = this.newCustomsEntryCodePrefix,
                CustomsEntryCode       = this.newCustomsEntryCode,
                CustomsEntryCodeDate   = this.newCustomsEntryCodeDate,
                Pallets                = new List <ConsignmentPalletResource>
                {
                    new ConsignmentPalletResource
                    {
                        PalletNumber = 1, Depth = 11, Height = 21, Weight = 31, Width = 41
                    },
                    new ConsignmentPalletResource
                    {
                        PalletNumber = 2, Depth = 1, Height = 2, Weight = 3, Width = 4
                    }
                },
                Items = new List <ConsignmentItemResource>
                {
                    new ConsignmentItemResource
                    {
                        ItemNumber = 1, Depth = 11, Height = 21, Weight = 31, Width = 41
                    },
                    new ConsignmentItemResource
                    {
                        ItemNumber = 2, Depth = 1, Height = 2, Weight = 3, Width = 4
                    }
                }
            };

            this.ConsignmentRepository.FindById(this.consignmentId).Returns(consignment);

            this.result = this.Sut.Update(this.consignmentId, this.updateResource);
        }