DotNetCore.SKIT.FlurlHttpCl.../test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/TestCase_ApiExecuteCgibinQrcodeTests.cs

31 lines
1.0 KiB
C#
Raw Normal View History

2022-01-21 17:06:31 +08:00
using System.Threading.Tasks;
2021-05-28 19:27:38 +08:00
using Xunit;
namespace SKIT.FlurlHttpClient.Wechat.Api.UnitTests
{
2022-01-21 16:57:42 +08:00
public class TestCase_ApiExecuteCgibinQrcodeTests
2021-05-28 19:27:38 +08:00
{
2022-01-21 16:57:42 +08:00
[Fact(DisplayName = "测试用例:调用 API [POST] /cgi-bin/qrcode/create")]
public async Task TestExecuteCgibinQrcodeCreate()
2021-05-28 19:27:38 +08:00
{
var request = new Models.CgibinQrcodeCreateRequest()
{
AccessToken = TestConfigs.WechatAccessToken,
ExpiresIn = 30,
ActionType = "QR_STR_SCENE",
Action = new Models.CgibinQrcodeCreateRequest.Types.Action()
2022-01-21 17:06:31 +08:00
{
2021-05-28 19:27:38 +08:00
Scene = new Models.CgibinQrcodeCreateRequest.Types.Action.Types.Scene()
2022-01-21 17:06:31 +08:00
{
2021-05-28 19:27:38 +08:00
SceneString = "FAKE_SCENESTR"
}
}
};
var response = await TestClients.Instance.ExecuteCgibinQrcodeCreateAsync(request);
Assert.NotNull(response.Ticket);
Assert.NotNull(response.Url);
}
}
}