示例#1
0
        private static OrderRequestReceivedMessage GetOrder()
        {
            var order = new OrderRequestReceivedMessage
            {
                CustomerPO              = "SRC009680",
                BusinessPartnerCode     = BusinessPartner.Initech.Code,
                BusinessPartnerNumber   = BusinessPartner.Initech.Number,
                ControlNumber           = "110001",
                DocumentId              = EdiDocumentTypes.PurchaseOrder.DocumentNumber,
                GeographicLocation      = "Tennessee",
                SpecificLocationNumber  = "4",
                PhoneNumber             = "901-263-6584",
                RequestDate             = "7/14/2009 12:00:00 AM",
                CustomerBankDescription = "Initech",
                Customer = new Customer
                {
                    CustomerIDs = new CustomerAliases()
                    {
                        LegacyCustomerID = "FEDE021"
                    },
                    CustomerName = "Initech",
                    Terms        = new TermsOfSale
                    {
                        DiscountDays    = 0,
                        DiscountPercent = 0,
                        NetDays         = 30
                    }
                }
            };

            order.AddAddress(new Address
            {
                AddressType = AddressTypeConstants.ShipTo,
                AddressName = "Initech SUSIE CARNEY",
                Address1    = "90 Initech PARKWAY",
                City        = "Collierville",
                State       = "TN",
                Zip         = "38017",
                Country     = "US"
            });
            order.Add(new CustomerOrderLine
            {
                CustomerPartNumber = "900104",
                ItemDescription    = "That thing",
                RequestedPrice     = 1.55m,
                RequestedQuantity  = 260,
                LineNumber         = 1
            });
            order.Add(new CustomerOrderLine
            {
                CustomerPartNumber = "AAGES7",
                ItemDescription    = "BOX, MONITOR FLAT PANEL 17\"",
                OrderMultiple      = 0,
                RequestedPrice     = 1,
                RequestedQuantity  = 1,
                LineNumber         = 1,
                TestMode           = false,
            });
            return(order);
        }
示例#2
0
        public void can_add_addresses()
        {
            _sut.Customer = new Customer();
            var billToAddress = new Address {
                AddressType = AddressTypeConstants.BillTo
            };

            _sut.AddAddress(billToAddress);
            var shipToAddress = new Address {
                AddressType = AddressTypeConstants.ShipTo
            };

            _sut.AddAddress(shipToAddress);

            _sut.GetBillToAddress().ShouldBeSameAs(billToAddress);
            _sut.ShipToAddress.ShouldBeSameAs(shipToAddress);
        }
示例#3
0
        private OrderRequestReceivedMessage GetOrder()
        {
            var order = new OrderRequestReceivedMessage
            {
                ControlNumber         = "0005456",
                CustomerPO            = "C04134707",
                RequestDate           = "20090318",
                BusinessPartnerCode   = BusinessPartner.Initech.Code,
                BusinessPartnerNumber = BusinessPartner.Initech.Number,
                BusinessProcessName   = "Initech Purchase Order Processing",
                Customer =
                    new Customer {
                    CustomerIDs = new CustomerAliases()
                    {
                        LegacyCustomerID = BusinessPartner.Initech.Code
                    }, CustomerName = "Initech"
                }
            };

            order.AddAddress(new Address
            {
                Address1    = "1900 Mockingbird Ln",
                AddressType = AddressTypeConstants.ShipTo,
                AddressCode = new AddressCode {
                    CustomerCode = "AEGW"
                }
                ,
                AddressName = "Billy Bob",
                City        = "Hackensack",
                State       = "New Jersey",
                Zip         = "01234"
            });
            order.Add(new CustomerOrderLine
            {
                CustomerPartNumber = "146525",
                ItemId             = "FIN23430I0",
                LineNumber         = 1,
                RequestedQuantity  = 4,
                RequestedPrice     = 1,
                ItemDescription    = ""
            });
            order.Add(new CustomerOrderLine
            {
                CustomerPartNumber = "CAD33",
                ItemId             = "FIN23430I044",
                LineNumber         = 2,
                RequestedQuantity  = 4,
                RequestedPrice     = 1,
                ItemDescription    = ""
            });
            return(order);
        }
示例#4
0
        public void can_add_address()
        {
            _sut = new OrderRequestReceivedMessage {
                Customer = new Customer {
                    CustomerIDs = new CustomerAliases()
                    {
                        LegacyCustomerID = "BLORG"
                    }
                }
            };
            _sut.AddAddress(new Address
            {
                AddressType = AddressTypeConstants.ShipTo,
                AddressName = "Yop"
            });

            Address shipTo = _sut.ShipToAddress;

            Assert.That(shipTo.AddressName == "Yop");
        }
示例#5
0
        public void publish_CreateOrderMessage()
        {
            var messaage = new OrderRequestReceivedMessage
            {
                BusinessPartnerCode   = BusinessPartner.Initech.Code,
                BusinessPartnerNumber = BusinessPartner.Initech.Number,
                ControlNumber         = "1",
                CustomerPO            = "PO-100",
                Customer = new Customer {
                    CustomerIDs = new CustomerAliases()
                    {
                        LegacyCustomerID = "100"
                    }, CustomerName = "test co."
                },
                BusinessProcessName = "business process name",
                RequestDate         = SystemTime.Now().ToString()
            };

            messaage.AddAddress(new Address
            {
                Address1    = "test addr1",
                Address2    = "addr2",
                AddressCode = new AddressCode()
                {
                    CustomerCode = "TEST"
                },
                AddressName = "office",
                AddressType = AddressTypeConstants.ShipTo,
                City        = "austin",
                State       = "TX",
                Zip         = "88888"
            });

            messaage.Add(new CustomerOrderLine
            {
                CustomerIDs = new CustomerAliases()
                {
                    LegacyCustomerID = "100"
                },
                CustomerPartNumber = "222",
                CustomerPO         = "333",
                ItemDescription    = "desc",
                ItemId             = "444",
                LineNumber         = 1,
                Notes             = "note",
                OrderMultiple     = 1,
                OrderNumber       = "555",
                RequestedPrice    = 6.0m,
                RequestedQuantity = 2,
                RequestNumber     = "1",
                TestMode          = true
            });
            messaage.LineItems.Add(new CustomerOrderLine
            {
                CustomerIDs = new CustomerAliases()
                {
                    LegacyCustomerID = "100"
                },
                CustomerPartNumber = "222b",
                CustomerPO         = "333b",
                ItemDescription    = "descb",
                ItemId             = "444b",
                LineNumber         = 2,
                Notes             = "noteb",
                OrderMultiple     = 2,
                OrderNumber       = "555b",
                RequestedPrice    = 7.0m,
                RequestedQuantity = 3,
                RequestNumber     = "1b",
                TestMode          = true
            });

            Thread.Sleep(4000);

            Bus.Instance().Publish(messaage);
        }