Skip to content
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

Search options builder for search adapter #52

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

spanersoraferty
Copy link
Collaborator

No description provided.

@@ -88,54 +87,18 @@ public async Task Search_SendsCorrectRequestToSearchService()
searchOptionsPassedToSearchService?.Facets.Should().BeEquivalentTo(searchServiceAdapterRequest.Facets);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test to check that the SearchOptionsBuilder is called correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So are you talking about adding verifications for everything we inject into the constructor, think this was a test you put in originally so did enough to correct based on the revised dependency?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a unit test I would test that everything I pass into SearchAsync is passed on to the calls made from within the method, so I suppose in this case, I could check that every method of the builder class is called, or I could check that the _searchByKeywordService.SearchAsync method is called with all the right values .. which is almost done, except that not all of the searchOptions passed in are checked.
If I comment out lines 83-85 in the CognitiveSearchAdapter::SearchAsync method, no tests fail, so the test that's called Search_SendsCorrectRequestToSearchService isn't checking that everything is sent

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but if you're saying that I hadn't tested it properly before, then I apologise, but I think we knew that, which was the reason for doing the refactor - so it was easier to test?

@CathLass CathLass merged commit 72ebfde into main Oct 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants