Uh oh!
There was an error while loading. Please reload this page.
Add HttpMethod.Query to static method test data - #129790
Conversation
Tagging subscribers to this area: @karelz, @dotnet/ncl |
There was a problem hiding this comment.
Pull request overview
Updates the HttpMethodTest functional tests to include the HttpMethod.Query singleton in the shared static-method test data used by the hash-code theory, improving coverage consistency for built-in HttpMethod instances.
Changes:
- Add
HttpMethod.Queryto theStaticHttpMethodstest data set used by[MemberData]. - Update the static-method list formatting to accommodate the new entry.
Uh oh!
There was an error while loading. Please reload this page.
Replace separate MemberData lists with a single canonical StaticHttpMethods List<HttpMethod> containing all known HTTP methods (Connect, Delete, Get, Head, Options, Patch, Post, Put, Query, Trace). Convert GetHashCode_StaticMethods and Parse_KnownMethod tests from Theory with MemberData to Fact with foreach loops over StaticHttpMethods. Remove the Parse_UsesKnownInstances_MemberData helper and AddStaticHttpMethods static initializer — the list is now declared directly as a field. This eliminates the duplication of having the static methods list defined in three different places.
…vanzDev/runtime into httpmethod-query-test-data
NicoAvanzDev
commented
Jun 25, 2026
@dotnet-policy-service agree |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Add a StaticHttpMethods_MemberData source derived from the StaticHttpMethods list and use it to drive GetHashCode_StaticMethods and Parse_KnownMethod as [Theory] cases again. This keeps the single canonical StaticHttpMethods list while preserving per-method failure granularity — each method runs as its own case rather than being hidden behind a single [Fact] loop that exits on first failure.
…vanzDev/runtime into httpmethod-query-test-data
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…verage - Make StaticHttpMethods private and immutable (IReadOnlyList backed by array) to prevent accidental mutation and inter-test coupling - Remove redundant ToUpperInvariant() call in Parse_KnownMethod test - Add ToMixedCase() helper and restore meaningful case-insensitivity coverage by testing lower-case and mixed-case variants alongside exact case
Uh oh!
There was an error while loading. Please reload this page.
Summary
Testing