我有一个像下面的示例中的类,我想单元测试方法UpdateDocumentAsync,但我不知道如何。你知道我该怎么测试呢?
public class MyElasticSearchClient
{
private readonly IElasticClient client;
...
public async Task<bool> UpdateDocumentAsync<T>(string index, string type, string id, T updated) where T : class
{
var response = await client.UpdateAsync<T, object>(u => u
.Index(index)
.Type(type)
.Id(id)
.Doc(updated)
.RetryOnConflict(3)
.Refresh()
).ConfigureAwait(false);
return response.ConnectionStatus.Success;
}
}