Make Request properties and VCRHandler type public #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
Request
object has all its properties set to internal visibility.However, it is exposed in the
IInteractionConverter
type under the assumption that an implementation living outside of EasyVCR would be able to return a fully hydrated instance.More importantly, this defeats the purpose of the
MatchRules
.ByCustomRule
method, which providesRequest
objects forrecorded
andreceived
parameters, where the implementor can access absolutely nothing (except though reflection of course).The test cases do not catch this due to
InternalsVisibleTo
being applied to the test assembly.Also make the
VCRHandler
type public, as there is a specific test stating that its construction should be possible by a user of the library (ClientTest
.TestVCRHandler
).It is especially needed to test code using https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-8.0, and dependency injection, especially to be able to inject the handler as indicated in https://learn.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-8.0#outgoing-request-middleware.
Testing
I did not write any test.
If this was deemed necessary, then probably test assemblies should be split in two, one for testing the public usage of the library, another relying on internals ? Or an intermediary test utils assembly which would expose publicly methods to act on the internals for tests could be created, to ensure access to internals is under control in tests ?
Pull Request Type
Please select the option(s) that are relevant to this PR.