public void CreateCardTest() { var accessToken = AccessTokenContainer.GetAccessToken(_appId); var data = new Card_GrouponData() { base_info = _BaseInfo, deal_detail = "测试" }; var result = CardApi.CreateCard(accessToken, data); Console.Write(result); Assert.IsNotNull(result); var data3 = new Card_CashData() { base_info = _BaseInfo, least_cost = 11, reduce_cost = 11 }; var result3 = CardApi.CreateCard(accessToken, data3); Console.WriteLine(result3); Assert.IsNotNull(result3); var data2 = new Card_MeetingTicketData() { base_info = _BaseInfo, //map_url = "http://localhost:18666/images/v2/logo%20.png", meeting_detail = "测试asdsasdsasdsa" }; var result2 = CardApi.CreateCard(accessToken, data2); Assert.IsNotNull(result2); Console.WriteLine(result2.errmsg); }
public void CreateCardTest() { var accessToken = AccessTokenContainer.GetToken(_appId); var data = new Card_GrouponData() { base_info = _BaseInfo, deal_detail = "测试" }; var result = CardApi.CreateCard(accessToken, data); Console.Write(result); Assert.IsNotNull(result); }
public IEnumerable <string> Get() { try { AccessTokenContainer.Register("wx4f8e94b7a153ff43", "700fcec799b8ff8f1463eb31585eafbc"); var accessToken = AccessTokenContainer.GetAccessToken("wx4f8e94b7a153ff43"); Card_GrouponData data1 = new Card_GrouponData() { base_info = _BaseInfo, deal_detail = "测试" }; //string json = JsonConvert.SerializeObject(card_BaseInfoBase); var result1 = CardApi.CreateCard(accessToken, data1); var data = new Card_MemberCardData() { base_info = _BaseInfo, supply_bonus = true, supply_balance = false, prerogative = "123123", bind_old_card_url = "www.daidu.com", wx_activate = true }; var result = CardApi.CreateCard(accessToken, data); } catch (Exception ex) { throw; } return(new string[] { "value1", "value2" }); }
public void ConvertTest() { try { var appId = ""; var appSecret = ""; var accessToken = AccessTokenContainer.TryGetAccessToken(appId, appSecret); Card_GrouponData data1 = new Card_GrouponData() { base_info = _BaseInfo, deal_detail = "测试" }; //这个位置报错 var result1 = CardApi.CreateCard(accessToken, data1); var data = new Card_MemberCardData() { base_info = _BaseInfo, supply_bonus = true, supply_balance = false, prerogative = "123123", bind_old_card_url = "www.senparc.com", wx_activate = true }; var result = CardApi.CreateCard(accessToken, data); System.Console.WriteLine(result.ToJson()); } catch (Exception ex) { //这里如果刨除微信层面的异常,说明之前发送阶段已经测试通过 Assert.IsInstanceOfType(ex, typeof(WeixinException)); } }