You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an assertion fails, it is not always clear which request are actually made. This requires that you debug a test instead of reading the message.
Besides that it is a kind of mismatch of methods that you need to use and most of them have overloads for the number of requests that are made with the specific conditions.
All in all, it seems better to improve the whole assertion part of TestableHttpClient and make things easier.
Alternatively, Something like the UriPattern class for the HttpRequestMessage could work as well. It will make the whole experience more flexible and consistent with how requests are made as well:
The biggest advantage is that you can just create a pattern for the complete request and test it in one go.
The disadvantage is that it could be more difficult to create the most sensible error messages...
The text was updated successfully, but these errors were encountered:
dnperfors
changed the title
Add description of the requests that are made
Refactor the assertion mechanism (was: Add description of the requests that are made)
Oct 19, 2023
When an assertion fails, it is not always clear which request are actually made. This requires that you debug a test instead of reading the message.
Besides that it is a kind of mismatch of methods that you need to use and most of them have overloads for the number of requests that are made with the specific conditions.
All in all, it seems better to improve the whole assertion part of TestableHttpClient and make things easier.
Take the following example:
This is very verbose and can be shortened to:
Then there could be overloads for testing the content as well:
Testing for headers happens in the same way as before:
Alternatively, Something like the UriPattern class for the HttpRequestMessage could work as well. It will make the whole experience more flexible and consistent with how requests are made as well:
The biggest advantage is that you can just create a pattern for the complete request and test it in one go.
The disadvantage is that it could be more difficult to create the most sensible error messages...
The text was updated successfully, but these errors were encountered: