-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
The documentation is very limited.
https://github.com/elastic/elastic-transport-net/blob/main/README.md#mocking-response-objects-for-testing
var elasticsearchClient = new Mock<ElasticsearchClient>();
var response = TestableResponseFactory.CreateSuccessfulResponse<StringResponse>(new(), 200);
elasticsearchClient.Setup(x => x.Transport.RequestAsync<StringResponse>(
It.IsAny<HttpMethod>(),
It.IsAny<string>(),
It.IsAny<PostData>(),
It.IsAny<RequestParameters>(),
It.IsAny<OpenTelemetryData>(),
It.IsAny<CancellationToken>())).ReturnsAsync(response);
I'm getting this in Moq: Non-overridable members (here: HttpTransport.RequestAsync) may not be used in setup / verification expressions.
@flobernd @stevejgordon @Mpdreamz
Metadata
Metadata
Assignees
Labels
No labels