我是 TDD 新手,能否请您使用 moq 编写测试用例以获取以下代码 -
public async Task<Model> GetAssetDeliveryRecordForId(string id)
{
var response = await client.GetAsync($"api/getdata?id={id}");
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsAsync<Model>();
return result;
}
Run Code Online (Sandbox Code Playgroud)
提前致谢。