Beispiel #1
0
        public void TestSaveBusData_GetOpBulkSettlement()
        {
            AliOpBulkSettlementHandle rcv = new AliOpBulkSettlementHandle();
            string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"aa3cbd3b-de0c-4779-8596-6724864d7a13\",\"RcvId\":\"199012010\"}";

            rcv.analyseBussdata("GetOpBulkSettlement", data);
            string   ret = "";
            FileInfo f   = new FileInfo(@"E:\1688云端\json2.json");

            using (FileStream fs = f.OpenRead())
            {
                int n;
                using (MemoryStream ms = new MemoryStream())
                {
                    byte[] cach = new byte[255];
                    while ((n = fs.Read(cach, 0, cach.Length)) > 0)
                    {
                        ms.Write(cach, 0, n);
                    }
                    ret = System.Text.Encoding.Default.GetString(ms.ToArray());
                    ms.Close();
                }

                fs.Close();
            }
            AliDataAccess ada = new AliDataAccess();

            ada.SaveBusData(rcv, ret);
        }
Beispiel #2
0
        public void TestReceiveGoods()
        {
            AliOpBulkSettlementHandle handle = new AliOpBulkSettlementHandle();
            string data = "{ \"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"9ee0ac93-0aae-45f5-a671-ca7564280a3a\",\"SubAccount\":\"dongyl3333\",\"ReceiveDate\":\"2019-08-28\",\"InsideRemark\":\"memo1\",\"OutsideRemark\":\"memo2\",\"ReceivedDetails\":[{\"EntryId\":89275021,\"realQuantity\":3},{\"EntryId\":89275020,\"realQuantity\":5}]}";

            handle.analyseBussdata("ReceiveGoods", data);
            string  ret = handle.Post();
            JObject obj = JsonConvert.DeserializeObject <JObject>(ret);

            Assert.IsTrue(obj.Value <bool>("success"), obj.Value <string>("message"));
        }
Beispiel #3
0
        public void TestQueryReceiveGoods()
        {
            AliOpBulkSettlementHandle handle = new AliOpBulkSettlementHandle();
            string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"9ee0ac93-0aae-45f5-a671-ca7564280a3a\",\"Id\":75142}";

            handle.analyseBussdata("QueryReceiveGoods", data);
            string  ret = handle.Post();
            JObject obj = JsonConvert.DeserializeObject <JObject>(ret);

            Assert.IsTrue(obj.Value <bool>("success"), obj.Value <string>("message"));
        }
Beispiel #4
0
        public void TestReceiveOrder()
        {
            AliOpBulkSettlementHandle handle = new AliOpBulkSettlementHandle();
            string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"9ee0ac93-0aae-45f5-a671-ca7564280a3a\",\"OrderId\":\"88786898\",\"ReceivedDetails\":[{\"orderEntryId\":\"88786900\",\"quantity\":1,\"realQuantity\":1}]}";

            handle.analyseBussdata("ReceiveOrder", data);
            string  ret   = handle.Post();
            JObject obj   = JsonConvert.DeserializeObject <JObject>(ret);
            string  error = obj.Value <string>("error_message");

            Assert.IsFalse(!string.IsNullOrWhiteSpace(error), error);
        }
Beispiel #5
0
        public void TestConfirmGoods()
        {
            AliOpBulkSettlementHandle handle = new AliOpBulkSettlementHandle();
            string data = "{\"AppKey\":\"334362\",\"AppSecret\":\"w5v9Xu2sK2y5\",\"TokenKey\":\"9ee0ac93-0aae-45f5-a671-ca7564280a3a\",\"Code\":\"1001001005\",\"Detials\":[{\"NgPurId\":\"637008587391704596\",\"NgPurDetailId\":\"3001\",\"Qty\":7,\"UntaxPrc\":10,\"UntaxAmt\":70,\"TaxPrc\":12,\"TaxAmt\":84,\"End\":false}]}";

            handle.analyseBussdata("ConfirmGoods", data);
            string  ret   = handle.Post();
            JObject obj   = JsonConvert.DeserializeObject <JObject>(ret);
            string  error = obj.Value <string>("error_message");

            Assert.IsFalse(!string.IsNullOrWhiteSpace(error), error);
        }