-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InitIndex method is returning SearchIndex rather than ISearchIndex #745
Comments
Hello! I've open a PR that I'll reopen when we will do a new major version of the client since this change is breaking. Because we cannot implicitly convert an interface to a class. It's still in discussion if the DX is good enough to return an interface instead of the class. I understand about mocking needs. |
Is there any progress on this? It's still not possible to mock |
+1 for this from me. I've recently started using Algolia in my .NET application and was surprised to see that This has made writing unit tests around my application logic that consumes the Algolia search results more difficult than it needs to be since I've had to wrap Algolia client code within a custom interface that I can stub out for testing purposes. |
Hello, A new client has been released on Nuget. You can now easily mock you test thanks to the interface returned by all clients (Search, Recommend, Insights, ...) If you have time, we need customer feedback about this new version. It's still not GA so you may not want to use it in production. There is no more deps on Newtonsoft, all Algolia APIs are now available (Insights, Recommend, Query Perso, ...) and all models and routes are synced. To help you migrate, there is a Migration guide. Happy to help in your migration process ! |
I was building some unit tests for my code using the Moq library and I was not able to mock the
InitIndex
method since is not returningISearchIndex
.For example, I'm not able to do that;
I think it would be more appropriate having:
rather than:
in
ISearchClient
.The text was updated successfully, but these errors were encountered: