public static CustomsDeclaration getDefaultObject_2()
        {
            CustomsItem customsItem     = CustomsItemTest.getDefaultObject();
            Address     addressImporter = AddressTest.getDefaultObject();
            Hashtable   parameters      = new Hashtable();

            parameters.Add("exporter_reference", "");
            parameters.Add("importer_reference", "");
            parameters.Add("contents_type", "MERCHANDISE");
            parameters.Add("contents_explanation", "T-Shirt purchase");
            parameters.Add("invoice", "#123123");
            parameters.Add("license", "");
            parameters.Add("certificate", "");
            parameters.Add("notes", "");
            parameters.Add("eel_pfc", "NOEEI_30_37_a");
            parameters.Add("aes_itn", "");
            parameters.Add("non_delivery_option", "ABANDON");
            parameters.Add("certify", true);
            parameters.Add("certify_signer", "Laura Behrens Wu");
            parameters.Add("address_importer", addressImporter.ObjectId);
            parameters.Add("incoterm", "");
            parameters.Add("metadata", "Order ID #123123");
            parameters.Add("b13a_filing_option", "FILED_ELECTRONICALLY");
            parameters.Add("b13a_number", "AA9999202008311");

            JArray customsItems = new JArray();

            customsItems.Add((string)customsItem.ObjectId);

            parameters.Add("items", customsItems);
            return(getAPIResource().CreateCustomsDeclaration(parameters));
        }
        public static CustomsDeclaration getDefaultObject()
        {
            CustomsItem customsItem = CustomsItemTest.getDefaultObject();
            Hashtable   parameters  = CustomsDeclarationTest.getDefaultParameters();

            return(getAPIResource().CreateCustomsDeclaration(parameters));
        }
Exemplo n.º 3
0
        public void testValidRetrieve()
        {
            CustomsItem testObject = CustomsItemTest.getDefaultObject();
            CustomsItem retrievedObject;

            retrievedObject = apiResource.RetrieveCustomsItem((string)testObject.ObjectId);
            Assert.AreEqual(testObject.ObjectId, retrievedObject.ObjectId);
        }
Exemplo n.º 4
0
        public static Hashtable getDefaultParameters()
        {
            Hashtable parameters = new Hashtable();

            parameters.Add("exporter_reference", "Exporter Reference");
            parameters.Add("importer_reference", "Importer Reference");
            parameters.Add("contents_type", "MERCHANDISE");
            parameters.Add("contents_explanation", "T-Shirt purchase");
            parameters.Add("invoice", "#123123");
            parameters.Add("license", "License");
            parameters.Add("certificate", "Certificate");
            parameters.Add("notes", "Notes");
            parameters.Add("eel_pfc", "NOEEI_30_37_a");
            parameters.Add("aes_itn", "X20180426506889");
            parameters.Add("non_delivery_option", "ABANDON");
            parameters.Add("certify", true);
            parameters.Add("certify_signer", "Laura Behrens Wu");
            parameters.Add("incoterm", "");
            parameters.Add("b13a_filing_option", "FILED_ELECTRONICALLY");
            parameters.Add("b13a_number", "AA9999202008311");
            parameters.Add("metadata", "Order ID #123123");

            JArray      customsItems = new JArray();
            CustomsItem customsItem  = CustomsItemTest.getDefaultObject();

            customsItems.Add((string)customsItem.ObjectId);
            parameters.Add("items", customsItems);

            var invoicedCharges = new Dictionary <String, String>()
            {
                { "total_shipping", "1.23" },
                { "total_taxes", "4.56" },
                { "total_duties", "78.90" },
                { "other_fees", "9.87" },
                { "currency", "USD" }
            };

            parameters.Add("invoiced_charges", invoicedCharges);

            var taxId = new Dictionary <String, String>()
            {
                { "number", "123456789" },
                { "type", "EIN" }
            };
            var exporterIdentification = new Dictionary <String, Object>()
            {
                { "eori_number", "PL12345678912345" },
                { "tax_id", taxId }
            };

            parameters.Add("exporter_identification", exporterIdentification);

            return(parameters);
        }
Exemplo n.º 5
0
        public void TestValidCreate()
        {
            Hashtable   parameters = getDefaultParameters();
            CustomsItem testObject = CustomsItemTest.getDefaultObject();

            Assert.AreEqual("VALID", testObject.ObjectState);
            Assert.AreEqual(parameters["description"], testObject.Description);
            Assert.AreEqual(int.Parse((string)parameters["quantity"]), testObject.Quantity);
            Assert.AreEqual(parameters["net_weight"], testObject.NetWeight);
            Assert.AreEqual(parameters["mass_unit"], testObject.MassUnit);
            Assert.AreEqual(parameters["value_amount"], testObject.ValueAmount);
            Assert.AreEqual(parameters["value_currency"], testObject.ValueCurrency);
            Assert.AreEqual(parameters["tariff_number"], testObject.TariffNumber);
            Assert.AreEqual(parameters["origin_country"], testObject.OriginCountry);
            Assert.AreEqual(parameters["sku_code"], testObject.SkuCode);
            Assert.AreEqual(parameters["eccn_ear99"], testObject.EccnEar99);
            Assert.AreEqual(parameters["metadata"], testObject.Metadata);
        }
Exemplo n.º 6
0
        public void TestValidCreate()
        {
            CustomsItem testObject = CustomsItemTest.getDefaultObject();

            Assert.AreEqual("VALID", testObject.ObjectState);
        }