mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-11-10 11:25:01 +08:00
init commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
|
||||
{
|
||||
public class WechatApiExecuteSnsWithAccessTokenTests
|
||||
{
|
||||
[Fact(DisplayName = "[GET] /sns/userinfo")]
|
||||
public async Task SnsUserInfoTest()
|
||||
{
|
||||
var request = new Models.SnsUserInfoRequest()
|
||||
{
|
||||
AccessToken = "FAKE_SNSACCESSTOKEN",
|
||||
OpenId = TestConfigs.WechatOpenId
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteSnsUserInfoAsync(request);
|
||||
|
||||
Assert.NotNull(response.OpenId);
|
||||
Assert.NotNull(response.Nickname);
|
||||
}
|
||||
|
||||
[Fact(DisplayName = "[GET] /sns/auth")]
|
||||
public async Task SnsAuthTest()
|
||||
{
|
||||
var request = new Models.SnsAuthRequest()
|
||||
{
|
||||
AccessToken = "FAKE_SNSACCESSTOKEN",
|
||||
OpenId = TestConfigs.WechatOpenId
|
||||
};
|
||||
var response = await TestClients.Instance.ExecuteSnsAuthAsync(request);
|
||||
|
||||
Assert.Equal(0, response.ErrorCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user