Added ExpectedContent to URI Groups
What this PR does / why we need it: Adds the ExpectedContent method to the IURIOptions to be able to expect a specific phrase in the response of the URL.
Which issue(s) this PR fixes: None, it's a new feature
Please reference the issue this PR will close: #[issue number]
Special notes for your reviewer:
Does this PR introduce a user-facing change?: No
Please make sure you've completed the relevant tasks for this PR, out of the following list:
- [x] Code compiles correctly
- [x] Created/updated tests
- [x] Unit tests passing
- [ ] End-to-end tests passing
- [ ] Extended the documentation
- [] Provided sample for the feature
@roblohmann After #1175 being merged there is API approval file in each project. You need to update is to reflect your changes in public API if any.
@roblohmann I resolved formatting and build issues. One suggestion left. Also update API approval file.
@roblohmann I resolved formatting and build issues. One suggestion left. Also update API approval file.
Thank you for your feedback and help in addopting this request. Also responded to your last suggestion.
Also update API approval file.
⬆️
Also update API approval file.
⬆️
What does this file do and how should I update it?
This file helps to track changes in public APIs. Run tests. Api approval test will fail. Remove .approved file and then rename .received file into .approved.
This file helps to track changes in public APIs. Run tests. Api approval test will fail. Remove .approved file and then rename .received file into .approved.
Just pushed new changed with fixed tests.
I'm fine to merge after fix approval file.
I'm fine to merge after fix approval file.
Ah yes, ran into this before and forgotten about it. Glad this PR finally can be merged :-)
I'll have a look at the approval file this friday.
I'm fine to merge after fix approval file.
Just updated the approval file. My apologies for the delay.
@roblohmann Build failed since I made some changes a bit ago. #1539
@sungam3r just merged remote master into this branch. PR should finally be able to go through now
Nope. This code does not compile. See other tests.
Nope. This code does not compile. See other tests.
Apologies, was in a rush when I merged and committed this. Also not on a machine with .net7. Just checked and updated the tests. Eveverything is atleast compiling. So I've put that remote now. Will check approval file at a later moment.
🎉
Looking through this code, it seems very limited. The ExpectedResponse needs to be the exact text (including case). Most health checks Ive seen give a return including totalDuration which will be different each time the url is called. This will mean the expected text will never work.
Something as simple as a list of expected strings that are contained in the response would better?
@SteveSitekitcare feel free to open a new issue.