public void WillSetShippingMethodToSecondDayAirEarly()
        {
            string shippingMethod             = "Priority";
            string expectedShippingMethodName = "ups next day air early a.m.";

            string shippingMethodName = BigCommerceHelper.GetShippingMethodName(shippingMethod);

            Assert.Equal(expectedShippingMethodName, shippingMethodName);
        }
        public void WillSetShippingMethodToUpsGround()
        {
            string shippingMethod             = "Free Shipping";
            string expectedShippingMethodName = "ups ground";

            string shippingMethodName = BigCommerceHelper.GetShippingMethodName(shippingMethod);

            Assert.Equal(expectedShippingMethodName, shippingMethodName);
        }
 public static void SetShippingInformation(ShippingAddress shippingAddress, OrderToImport request)
 {
     request.ShippingFirstName  = shippingAddress.first_name;
     request.ShippingLastName   = shippingAddress.last_name;
     request.ShippingCompany    = shippingAddress.company;
     request.ShippingLine1      = shippingAddress.street_1;
     request.ShippingLine2      = shippingAddress.street_2;
     request.ShippingCity       = shippingAddress.city;
     request.ShippingState      = NetSuiteHelper.GetStateByName(shippingAddress.state);
     request.ShippingZip        = shippingAddress.zip;
     request.ShippingCountry    = shippingAddress.country_iso2;
     request.ShippingPhone      = shippingAddress.phone;
     request.ShippingMethodName = BigCommerceHelper.GetShippingMethodName(shippingAddress.shipping_method);
 }
Exemplo n.º 4
0
        public void WillCreateNetSuiteRequest()
        {
            BigCommerceController.customerId = 2;
            Order           order           = CreateFakeBigCommerceOrder();
            ShippingAddress shippingAddress = CreateFakeShippingAddress();

            OrderToImport netsuiteRequest = NetSuiteController.CreateNetSuiteRequest(order, shippingAddress);

            Assert.Equal(order.billing_address.email, netsuiteRequest.Email);
            Assert.Equal(order.billing_address.phone, netsuiteRequest.PhoneNumber);
            Assert.Equal(NetSuiteController.b2bDepartmentId, netsuiteRequest.Department);
            Assert.Equal(order.ip_address, netsuiteRequest.IPAddress);
            Assert.Equal("BB1-866", netsuiteRequest.NestProId);

            Assert.Equal($"NP{order.id}", netsuiteRequest.SiteOrderNumber);
            Assert.Equal(order.payment_provider_id, netsuiteRequest.AltOrderNumber);
            Assert.Equal(NetSuiteController.micrositeId, netsuiteRequest.Microsite);
            Assert.Equal(NetSuiteController.registered, netsuiteRequest.CheckoutTypeId);
            Assert.Equal(Convert.ToDouble(order.base_shipping_cost), netsuiteRequest.SH);

            Assert.Equal(order.billing_address.first_name, netsuiteRequest.BillingFirstName);
            Assert.Equal(order.billing_address.last_name, netsuiteRequest.BillingLastName);
            Assert.Equal(order.billing_address.street_1, netsuiteRequest.BillingLine1);
            Assert.Equal(order.billing_address.street_2, netsuiteRequest.BillingLine2);
            Assert.Equal(order.billing_address.city, netsuiteRequest.BillingCity);
            Assert.Equal(NetSuiteHelper.GetStateByName(order.billing_address.state), netsuiteRequest.BillingState);
            Assert.Equal(order.billing_address.zip, netsuiteRequest.BillingZip);
            Assert.Equal(order.billing_address.country_iso2, netsuiteRequest.BillingCountry);
            Assert.Equal(NetSuiteController.generalContractor, netsuiteRequest.UserTypeId);

            Assert.Equal(shippingAddress.first_name, netsuiteRequest.ShippingFirstName);
            Assert.Equal(shippingAddress.last_name, netsuiteRequest.ShippingLastName);
            Assert.Equal(shippingAddress.street_1, netsuiteRequest.ShippingLine1);
            Assert.Equal(shippingAddress.street_2, netsuiteRequest.ShippingLine2);
            Assert.Equal(shippingAddress.city, netsuiteRequest.ShippingCity);
            Assert.Equal(NetSuiteHelper.GetStateByName(shippingAddress.state), netsuiteRequest.ShippingState);
            Assert.Equal(shippingAddress.zip, netsuiteRequest.ShippingZip);
            Assert.Equal(shippingAddress.country_iso2, netsuiteRequest.ShippingCountry);
            Assert.Equal(BigCommerceHelper.GetShippingMethodName(shippingAddress.shipping_method), netsuiteRequest.ShippingMethodName);
        }