Add Authorization header matching to IRequestBuilder#26
Conversation
718e341 to
ac3a4b7
Compare
|
I see there's complications when adding multiple headers, resulting in multiple matches. So I've changed this PR to add another header type instead of an open dictionary. |
sandermvanvliet
left a comment
There was a problem hiding this comment.
Thank you for creating this PR to extend the request matching 👍
I've left a few comments but nothing really major.
If you have the time would you be able to add an example of the usage to the README so that people are aware this is a possibility now?
| /// </summary> | ||
| /// <param name="authenticationHeader">A authorization header value</param> | ||
| /// <returns>The current <see cref="IRequestBuilder"/> instance</returns> | ||
| IRequestBuilder Authorization(AuthenticationHeaderValue authenticationHeader); |
There was a problem hiding this comment.
Could you change the name to AndAuthorization so that the usage is similar to AndContentType()?
So instead of
handler
.RespondTo()
.Post()
.ForUrl("/api/infos/")
.Authorization(new AuthenticationHeaderValue())
.With(HttpStatus.OK);have
handler
.RespondTo()
.Post()
.ForUrl("/api/infos/")
.AndAuthorization(new AuthenticationHeaderValue())
.With(HttpStatus.OK);
test/Codenizer.HttpClient.Testable.Tests.Unit/WhenMatchingRoutes.cs
Outdated
Show resolved
Hide resolved
test/Codenizer.HttpClient.Testable.Tests.Unit/WhenMatchingRoutes.cs
Outdated
Show resolved
Hide resolved
test/Codenizer.HttpClient.Testable.Tests.Unit/WhenMatchingRoutes.cs
Outdated
Show resolved
Hide resolved
test/Codenizer.HttpClient.Testable.Tests.Unit/WhenMatchingRoutes.cs
Outdated
Show resolved
Hide resolved
test/Codenizer.HttpClient.Testable.Tests.Unit/WhenMatchingRoutes.cs
Outdated
Show resolved
Hide resolved
|
Changed applied :) |
sandermvanvliet
left a comment
There was a problem hiding this comment.
Thanks for applying the changes 👍
|
I'm going to merge this and then do a little work because the workflow doesn't run at the moment given that the test project references |
|
Package has just been published as 2.11.0.0 |
Leveraged the existing header matching node and added configurable headers.