Skip to content

Commit

Permalink
Merge pull request #5 from JeffreySu/master
Browse files Browse the repository at this point in the history
同步
  • Loading branch information
bemguin committed May 18, 2015
2 parents eb72c68 + 7db841a commit 9d7a88e
Show file tree
Hide file tree
Showing 20 changed files with 706 additions and 250 deletions.
149 changes: 1 addition & 148 deletions Senparc.Weixin.MP.BuildOutPut/Senparc.Weixin.MP.XML

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Senparc.Weixin.MP.BuildOutPut/Senparc.Weixin.MP.dll
Binary file not shown.
Binary file modified Senparc.Weixin.MP.BuildOutPut/Senparc.Weixin.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -133,55 +133,55 @@ public void CardDetailGet()
Assert.IsNotNull(result);
}

protected Store_Location _StoreLocation = new Store_Location()
{
business_name = "TIT 创意园1 号店",
province = "广东省",
city = "广州市",
district = "海珠区",
address = "中国广东省广州市海珠区艺苑路11 号",
telephone = "020-89772059",
category = "房产小区",
longitude = "115.32375",
latitude = "25.097486"
};

[TestMethod]
public void StoreBatchAddTest()
{
var accessToken = AccessTokenContainer.GetToken(_appId);
var data = new StoreLocationData()
{
location_list = new List<Store_Location>()
{
_StoreLocation
},
};

var result = CardApi.StoreBatchAdd(accessToken, data);
Assert.IsNotNull(result);
Assert.AreEqual(result.errcode, ReturnCode.请求成功);
}
//protected Store_Location _StoreLocation = new Store_Location()
//{
// business_name = "TIT 创意园1 号店",
// province = "广东省",
// city = "广州市",
// district = "海珠区",
// address = "中国广东省广州市海珠区艺苑路11 号",
// telephone = "020-89772059",
// category = "房产小区",
// longitude = "115.32375",
// latitude = "25.097486"
//};

[TestMethod]
public void BatchGetTest()
{
var accessToken = AccessTokenContainer.GetToken(_appId);
//[TestMethod]
//public void StoreBatchAddTest()
//{
// var accessToken = AccessTokenContainer.GetToken(_appId);
// var data = new StoreLocationData()
// {
// location_list = new List<Store_Location>()
// {
// _StoreLocation
// },
// };

// var result = CardApi.StoreBatchAdd(accessToken, data);
// Assert.IsNotNull(result);
// Assert.AreEqual(result.errcode, ReturnCode.请求成功);
//}

var result = CardApi.BatchGet(accessToken, 0, 5);
Assert.IsNotNull(result);
Assert.AreEqual(result.errcode, ReturnCode.请求成功);
}
//[TestMethod]
//public void BatchGetTest()
//{
// var accessToken = AccessTokenContainer.GetToken(_appId);

[TestMethod]
public void UploadLogoTest()
{
string file = @"E:\1.jpg";
// var result = CardApi.BatchGet(accessToken, 0, 5);
// Assert.IsNotNull(result);
// Assert.AreEqual(result.errcode, ReturnCode.请求成功);
//}

var accessToken = AccessTokenContainer.GetToken(_appId);
var result = CardApi.UploadLogo(accessToken, file);
Assert.IsNotNull(result);
Assert.AreEqual(result.errcode, ReturnCode.请求成功);
}
//[TestMethod]
//public void UploadLogoTest()
//{
// string file = @"E:\1.jpg";

// var accessToken = AccessTokenContainer.GetToken(_appId);
// var result = CardApi.UploadLogo(accessToken, file);
// Assert.IsNotNull(result);
// Assert.AreEqual(result.errcode, ReturnCode.请求成功);
//}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Senparc.Weixin.MP.AdvancedAPIs.Poi;
using Senparc.Weixin.MP.CommonAPIs;
using Senparc.Weixin.MP.Entities;
using Senparc.Weixin.MP.Test.CommonAPIs;

namespace Senparc.Weixin.MP.Test.AdvancedAPIs
{
//已经通过测试
[TestClass]
public class PoiTest : CommonApiTest
{
[TestMethod]
public void UploadImageTest()
{
var accessToken = AccessTokenContainer.GetToken(_appId);

string file = @"E:\1.jpg";

var result = PoiApi.UploadImage(accessToken, file);
Assert.IsNotNull(result);
Assert.AreEqual(result.errcode, (int)ReturnCode.请求成功);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ public class RequestMessageFactoryTest
<ToKfAccount><![CDATA[test2@test]]></ToKfAccount>
</xml>";

private string xmlEvent_Poi_Check_Notify = @"<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>1408622107</CreateTime>
<MsgType><![CDATA[event]]></MsgType>
<Event><![CDATA[poi_check_notify]]></Event>
<UniqId><![CDATA[123adb]]></UniqId>
<PoiId><![CDATA[123123]]></PoiId>
<Result><![CDATA[fail]]></Result>
<Msg><![CDATA[xxxxxx]]></Msg>
</xml>";

[TestMethod]
public void GetRequestEntityTest()
{
Expand Down Expand Up @@ -625,6 +637,17 @@ public void GetRequestEntityTest()
Assert.AreEqual("test1@test", result.FromKfAccount);
Assert.AreEqual("test2@test", result.ToKfAccount);
}

{
//Event-Poi_Check_Notify
var doc = XDocument.Parse(xmlEvent_Poi_Check_Notify);
var result = RequestMessageFactory.GetRequestEntity(doc) as RequestMessageEvent_Poi_Check_Notify;
Assert.IsNotNull(result);
Assert.AreEqual("toUser", result.ToUserName);
Assert.AreEqual(Event.poi_check_notify, result.Event);
Assert.AreEqual("123adb", result.UniqId);
Assert.AreEqual("fail", result.Result);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<Compile Include="AdvancedAPIs\Groups\GroupTest.cs" />
<Compile Include="AdvancedAPIs\Media\MediaTest.cs" />
<Compile Include="AdvancedAPIs\OAuth\OAuthTest.cs" />
<Compile Include="AdvancedAPIs\Poi\PoiTest.cs" />
<Compile Include="AdvancedAPIs\Semantic\SemanticTest.cs" />
<Compile Include="AdvancedAPIs\Template\TemplateTest.cs" />
<Compile Include="CommonAPIs\JsApiTicketContainerTest.cs" />
Expand Down
Loading

0 comments on commit 9d7a88e

Please sign in to comment.