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_ApiExecuteSemanticTests
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
2022-01-21 16:57:42 +08:00
|
|
|
|
[Fact(DisplayName = "测试用例:调用 API [POST] /semantic/semproxy/search")]
|
|
|
|
|
public async Task TestExecuteSemanticSemproxySearchRestaurant()
|
2021-05-28 19:27:38 +08:00
|
|
|
|
{
|
|
|
|
|
var request = new Models.SemanticSemproxySearchRequest()
|
|
|
|
|
{
|
|
|
|
|
AccessToken = TestConfigs.WechatAccessToken,
|
|
|
|
|
UserId = TestConfigs.WechatOpenId,
|
|
|
|
|
Query = "中关村有没有人均100元左右的火锅店",
|
|
|
|
|
Category = "restaurant",
|
|
|
|
|
City = "北京"
|
|
|
|
|
};
|
|
|
|
|
var response = await TestClients.Instance.ExecuteSemanticSemproxySearchAsync<Models.SemanticSemproxySearchResponse.Types.RestaurantDetail>(request);
|
|
|
|
|
|
|
|
|
|
Assert.True(response.IsSuccessful());
|
|
|
|
|
Assert.NotNull(response.Query);
|
|
|
|
|
Assert.NotNull(response.Type);
|
|
|
|
|
Assert.NotNull(response.Semantic);
|
|
|
|
|
Assert.NotNull(response.Semantic.Detail);
|
|
|
|
|
Assert.NotNull(response.Semantic.Intent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|