Skip to content

Commit

Permalink
完善WxOpen单元测试的wxOpenAppId引用
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySu committed Jul 28, 2018
1 parent 6b044d5 commit 1dd0454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void SendTemplateMessageTest()
"在线购买",DateTime.Now,"图书众筹","1234567890",
100, "400-9939-858","http://sdk.senparc.weixin.com");

var result = TemplateApi.SendTemplateMessage(_appId, openId, data.TemplateId, data, "formSubmit", "pages/websocket",
var result = TemplateApi.SendTemplateMessage(_wxOpenAppId, openId, data.TemplateId, data, "formSubmit", "pages/websocket",
"keyword3");

Assert.AreEqual(ReturnCode.请求成功,result.errcode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void CreateWxaQrCodeTest()
var dt1 = DateTime.Now;
using (var ms = new MemoryStream())
{
var result = WxAppApi.CreateWxQrCode(base._appId, ms, "pages/websocket", 100);
var result = WxAppApi.CreateWxQrCode(base._wxOpenAppId, ms, "pages/websocket", 100);
Assert.AreEqual(ReturnCode.请求成功, result.errcode);

ms.Seek(0, SeekOrigin.Begin);
Expand All @@ -65,7 +65,7 @@ public void CreateWxaQrCodeTest2()
{
var dt1 = DateTime.Now;
var filePath = "../../Config/qr2.jpg";
var result = WxAppApi.CreateWxQrCode(base._appId, filePath, "pages/websocket", 100);
var result = WxAppApi.CreateWxQrCode(base._wxOpenAppId, filePath, "pages/websocket", 100);
var dt2 = DateTime.Now;
Console.WriteLine("执行时间:{0}ms", (dt2 - dt1).TotalMilliseconds);
}
Expand All @@ -78,7 +78,7 @@ public void CreateWxaQrCodeAsyncTest()
Task.Factory.StartNew(async () =>
{
var ms = new MemoryStream();
var result = await WxAppApi.CreateWxQrCodeAsync(base._appId, ms, "pages/websocket", 100);
var result = await WxAppApi.CreateWxQrCodeAsync(base._wxOpenAppId, ms, "pages/websocket", 100);
Assert.AreEqual(ReturnCode.请求成功, result.errcode);
ms.Seek(0, SeekOrigin.Begin);
Expand Down Expand Up @@ -110,7 +110,7 @@ public void CreateWxaQrCodeAsyncTest2()
var filePath = "../../Config/qr-async2.jpg";
Task.Factory.StartNew(async () =>
{
var result = await WxAppApi.CreateWxQrCodeAsync(base._appId, filePath, "pages/websocket", 100);
var result = await WxAppApi.CreateWxQrCodeAsync(base._wxOpenAppId, filePath, "pages/websocket", 100);
Assert.AreEqual(ReturnCode.请求成功, result.errcode);
Assert.IsTrue(File.Exists(filePath));
});
Expand All @@ -130,7 +130,7 @@ public void GetWxaCodeUnlimitTest()
{
var filePath = "../../Config/qr-unlimit.jpg";
var scene = "";
var result = WxAppApi.GetWxaCodeUnlimit(base._appId,filePath, scene, "pages/websocket", 100);
var result = WxAppApi.GetWxaCodeUnlimit(base._wxOpenAppId,filePath, scene, "pages/websocket", 100);
Assert.IsNotNull(result);
Assert.AreEqual(ReturnCode.请求成功, result.errcode);
}
Expand Down

0 comments on commit 1dd0454

Please sign in to comment.