Exemple #1
0
 public void TestMethod_PickJsonParameter()
 {
     string[] xx;
     xx = MyAssert.PickJsonParameter("subId", "{\"body\":{\"addTime\":1472526614000,\"addTimeStr\":\"2016-08-30 11:10\",\"address\":\"双城国际4号楼 江汉路1785号\",\"aliasName\":\"\",\"bestTime\":1472547600000,\"bestTimeStr\":\"2016-08-30 17:00\",\"bestTimeString\":\"今天\n17:00\n送达\",\"consignee\":\"双\",\"creditAmount\":0,\"deliverTime\":\"无\",\"discountAmount\":0,\"dueDate\":\"\",\"dueDateNum\":\"\",\"gainAmount\":0,\"goodsAmount\":12100,\"id\":7335,\"isFinish\":false,\"isFirst\":\"0\",\"isPurchase\":0,\"isRemind\":0,\"isReturn\":0,\"marker\":1,\"mobile\":\"15158155511\",\"oneself\":[],\"orderId\":10827571,\"orderSn\":\"KF1472526613161\",\"orderStatus\":\"派送中\",\"orderStatusStr\":\"shipping\",\"orderType\":\"1\",\"payAmount\":12600,\"payNote\":\"结算测试单\",\"payTimeStr\":\"\",\"retAmount\":0,\"sellerAddress\":\"\",\"sellerMobile\":\"\",\"sellerName\":\"\",\"shipAmount\":500,\"shippingAmount\":500,\"shippingTime\":1472526616000,\"shippingTimeStr\":\"2016-08-30 11:10\",\"shippingType\":\"0\",\"supermarket\":[],\"suppliers\":[{\"expressInfo\":{\"expressCode\":\"\",\"expressCompany\":\"\",\"expressSn\":\"\",\"useExpress\":false},\"goods\":[{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000}],\"info\":{\"aliasName\":\"\",\"avoid\":0,\"distribute\":0,\"isSupplier\":1,\"name\":\"\",\"phone\":\"\",\"sellerType\":1,\"start\":0,\"supplierId\":10000,\"supplierName\":\"ShopForBalance10000\"}}]},\"success\":true}");
     Console.WriteLine(xx);
     Assert.IsFalse(xx[0] != "9324", xx[0]);
     xx = MyAssert.PickJsonParameter("subId", "{\"body\":{\"addTime\":1472526614000,\"addTimeStr\":\"2016-08-30 11:10\",\"address\":\"双城国际4号楼 江汉路1785号\",\"aliasName\":\"\",\"bestTime\":1472547600000,\"bestTimeStr\":\"2016-08-30 17:00\",\"bestTimeString\":\"今天\n17:00\n送达\",\"consignee\":\"双\",\"creditAmount\":0,\"deliverTime\":\"无\",\"discountAmount\":0,\"dueDate\":\"\",\"dueDateNum\":\"\",\"gainAmount\":0,\"goodsAmount\":12100,\"id\":7335,\"isFinish\":false,\"isFirst\":\"0\",\"isPurchase\":0,\"isRemind\":0,\"isReturn\":0,\"marker\":1,\"mobile\":\"15158155511\",\"oneself\":[],\"orderId\":10827571,\"orderSn\":\"KF1472526613161\",\"orderStatus\":\"派送中\",\"orderStatusStr\":\"shipping\",\"orderType\":\"1\",\"payAmount\":12600,\"payNote\":\"结算测试单\",\"payTimeStr\":\"\",\"retAmount\":0,\"sellerAddress\":\"\",\"sellerMobile\":\"\",\"sellerName\":\"\",\"shipAmount\":500,\"shippingAmount\":500,\"shippingTime\":1472526616000,\"shippingTimeStr\":\"2016-08-30 11:10\",\"shippingType\":\"0\",\"supermarket\":[],\"suppliers\":[{\"expressInfo\":{\"expressCode\":\"\",\"expressCompany\":\"\",\"expressSn\":\"\",\"useExpress\":false},\"goods\":[{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000}],\"info\":{\"aliasName\":\"\",\"avoid\":0,\"distribute\":0,\"isSupplier\":1,\"name\":\"\",\"phone\":\"\",\"sellerType\":1,\"start\":0,\"supplierId\":10000,\"supplierName\":\"ShopForBalance10000\",\"subId\": 123}}]},\"success\":true}");
     Console.WriteLine(xx);
     Assert.IsFalse(xx[0] != "9324,123", xx[0]);
     xx = MyAssert.PickJsonParameter("subId", "[{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000},{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000,\"lijie\":[{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000},{\"goodsAttr\":\"0:0:件\",\"goodsDes\":\"\",\"goodsName\":\"高达1号机\",\"goodsNumber\":1,\"goodsSn\":\"00001\",\"goodsStatus\":\"已发货\",\"isSell\":0,\"name\":\"ShopForBalance10000\",\"orderStatuss\":\"have_purchase\",\"phone\":\"\",\"picUrl\":\"http://xp.liuxia8.cn/hlman-pic/goods/201601/1451973551583.jpg?s=220x220\",\"recPrice\":10000,\"remark\":\"1\",\"salePrice\":12100,\"sellerSkuId\":19100,\"sellerType\":\"1\",\"subId\":9324,\"supplierId\":10000}]}]");
     Console.WriteLine(xx);
     Assert.IsFalse(xx[0] != "9324,9324,9324,9324", xx[0]);
     xx = MyAssert.PickJsonParameter("token", " {\"body\":{\"account\":\"13000000001\",\"id\":10000,\"mobile\":\"13000000001\",\"name\":\"ShopForBalance\",\"roleList\":[\"seller\",\"seller\"],\"sellerList\":[{\"aliasName\":\"\",\"avoid\":0,\"distribute\":0,\"isDelete\":\"0\",\"isSupplier\":1,\"name\":\"ShopForBalance10000\",\"phone\":\"\",\"sellerId\":10000,\"start\":0,\"supplierId\":0,\"supplierName\":\"\"}],\"sellerQrcode\":\"http://xp.liuxia8.cn/huala/v3/qrcod-seller/\",\"sellerUrl\":\"http://xp.liuxia8.cn/huala/goshop/\",\"sex\":\"男\",\"state\":\"3\"},\"success\":true,\"token\":\"176c0e32-6072-40e2-89ac-df173cbbc2c6\"}");
     Console.WriteLine(xx);
     Assert.IsFalse(xx[0] != "176c0e32-6072-40e2-89ac-df173cbbc2c6", xx[0]);
 }