I'd like to Moq the response from the ElasticClient to show an error or some information in the DebugInformation property.
I have the following:
ISearchResponse<person> personResponse = new SearchResponse<person>();
personResponse.ApiCall = new ApiCallDetails
{
Success = false,
};
personResponse.DebugInformation = "Something happened"; //This is not allowed
_elasticClient.Setup(s =>
s.Search<person>(
It.IsAny<Func<SearchDescriptor<person>, ISearchRequest>>()))
.Returns(personResponse);
I am unable to assign to DebugInformation as it is readonly. Any ideas?