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

Add shared test infra for RDF and RDG #46838

Merged
merged 1 commit into from
Feb 27, 2023
Merged

Add shared test infra for RDF and RDG #46838

merged 1 commit into from
Feb 27, 2023

Conversation

captainsafia
Copy link
Member

Part of #46196.


var httpContext = CreateHttpContext();

var exception = await Assert.ThrowsAsync<InvalidOperationException>(() => endpoint.RequestDelegate(httpContext));
Copy link
Member

Choose a reason for hiding this comment

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

RDF would just try to read context.Request.RouteValues["invalidName"] even though it's not part of the pattern, right? I know this PR is just about tests and not fixing behavior, but do we agree that we should align behavior here?

Copy link
Member Author

Choose a reason for hiding this comment

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

RDF throws the exception earlier when the endpoint is being constructed (ref). We could do something similar in RDG, but that would mean presenting the exception at compile-time which would require us to have a way to parse the route patterns in the generator. #46342 tracks doing this work.

@captainsafia captainsafia merged commit 531a93a into main Feb 27, 2023
@captainsafia captainsafia deleted the safia/rdg-setup branch February 27, 2023 22:11
@ghost ghost added this to the 8.0-preview3 milestone Feb 27, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants