q
This commit is contained in:
@@ -15,6 +15,47 @@ namespace UnitTestProject1
|
||||
[TestClass]
|
||||
public class UnitTest1
|
||||
{
|
||||
public class TestEntity
|
||||
{
|
||||
public TestEntity(int _id, string _name)
|
||||
{
|
||||
id = _id;
|
||||
name = _name;
|
||||
}
|
||||
public int id;
|
||||
public string name;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethod2()
|
||||
{
|
||||
var list = new List<TestEntity>();
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(1,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
list.Add(new TestEntity(2,"ttetett"));
|
||||
|
||||
var ttt = list.GroupBy(x => x.id);
|
||||
|
||||
var count = ttt.Count();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestMethod1()
|
||||
{
|
||||
@@ -66,6 +107,7 @@ namespace UnitTestProject1
|
||||
|
||||
|
||||
auditList.Add(data);
|
||||
auditList.Add(data1);
|
||||
jsonMap.Add("itemList", auditList);
|
||||
|
||||
string json = JsonConvert.SerializeObject(jsonMap);
|
||||
@@ -76,17 +118,14 @@ namespace UnitTestProject1
|
||||
param.Add("name", "supvWarehouse.save");
|
||||
param.Add("app_key", appKey);
|
||||
param.Add("data", json);
|
||||
param.Add("timestamp", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
param.Add("timestamp", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
param.Add("version", "");
|
||||
string sign = BuildSign(param, secret);
|
||||
param.Add("sign", sign);
|
||||
|
||||
var ttt = @"{""entName"":""珠海昶展物流有限公司"",""entCusCode"":""4404660006"",""bookNum"":""T5781W000004"",""declaEntCreditCode"":""91440404MABRGQJR1H"",""deliveryType"":""QTCK"",""declaEntCusCode"":""4404660006"",""inputDate"":""2018-02-02 14:03:07"",""deliveryTm"":""2018-02-09 00:00:00"",""declaType"":""00"",""declaDate"":""2023-12-20 09:38:55"",""declaCode"":""QTCK000003"",""itemList"":[{""productDesc"":""喇叭"",""inventoryOrderNo"":""10"",""deliveryOrderNo"":""2"",""specificationsModels"":"" "",""hscode"":""8"",""deliveryCnt"":""80.0000000000"",""itemNo"":""1"",""inventory"":""9"",""productCd"":""100242"",""calcUnit"":""Pcs""},{""productDesc"":""听筒"",""inventoryOrderNo"":""10"",""deliveryOrderNo"":""2"",""specificationsModels"":"" "",""hscode"":""8"",""deliveryCnt"":""80.0000000000"",""itemNo"":""2"",""inventory"":""9"",""productCd"":""100243"",""calcUnit"":""Pcs""}],""entCreditCode"":""91440404MABRGQJR1H"",""declaEntName"":""珠海昶展物流有限公司"",""inputMan"":""demo"",""customsCode"":""5781""}";
|
||||
//var json = "{\"entName\":\"珠海昶展物流有限公司\",\"entCusCode\":\"4404660006\",\"bookNum\":\"T5781W000004\",\"declaEntCreditCode\":\"91440404MABRGQJR1H\",\"declaEntCusCode\":\"4404660006\",\"entCreditCode\":\"91440404MABRGQJR1H\",\"declaEntName\":\"珠海昶展物流有限公司\",\"inputMan\":\"demo\",\"customsCode\":\"5781\",\"inputDate\":\"2018-02-02 14:03:07\",\"declaType\":\"00\",\"deliveryTm\":\"2018-02-09 00:00:00\",\"declaDate\":\"2023-12-20 10:55:59\",\"deliveryType\":\"QTCK\",\"declaCode\":\"QTCK000003\",\"item\":[{\"itemNo\":\"1\",\"deliveryOrderNo\":\"2\",\"productCd\":\"100242\",\"productDesc\":\"喇叭\",\"specificationsModels\":\" \",\"deliveryCnt\":\"80.0000000000\",\"calcUnit\":\"Pcs\",\"hscode\":\"8\",\"inventory\":\"9\",\"inventoryOrderNo\":\"10\"},{\"itemNo\":\"2\",\"deliveryOrderNo\":\"2\",\"productCd\":\"100243\",\"productDesc\":\"听筒\",\"specificationsModels\":\" \",\"deliveryCnt\":\"80.0000000000\",\"calcUnit\":\"Pcs\",\"hscode\":\"8\",\"inventory\":\"9\",\"inventoryOrderNo\":\"10\"}]}";
|
||||
var jsonParam = JsonConvert.SerializeObject(param);
|
||||
|
||||
var ttt2 = JsonConvert.SerializeObject(param);
|
||||
|
||||
HttpWebHelper.DoPost("http://119.146.223.48:39082/api/", ttt2);
|
||||
var result = HttpWebHelper.DoPost("http://119.146.223.48:39082/api/", jsonParam);
|
||||
var a = 0.00M;
|
||||
var a2 = 0L;
|
||||
var f = (a == a2);
|
||||
@@ -146,4 +185,8 @@ namespace UnitTestProject1
|
||||
return sign.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user