Class WebPagePath

Namespace
ProtoTest.Web.Pages
Assembly
ProtoTest.Web.Pages.dll

Page identity for web coverage: the absolute path of an HTTP(S) address, without query or fragment, normalized to a leading slash and no trailing slash (except the root). One page, one identity, so a visit, a verification and an inventory entry land on the same coverage item. Query and fragment are stripped before anything else, so a relative path carrying an absolute URL in its query is still a page. Percent-encoding is decoded per segment on both the visit and the inventory side, so /a%20b and /a b are one identity; a segment that decodes to a slash keeps it encoded (%2F) so one segment never becomes two.

public static class WebPagePath
Inheritance
WebPagePath
Inherited Members

Methods

FromAddress(string?)

The coverage path of a full address, or null when it is not a page.

public static string? FromAddress(string? address)

Parameters

address string

Returns

string

FromUri(Uri?)

The coverage path of a full address, or null when it is not a page.

public static string? FromUri(Uri? address)

Parameters

address Uri

Returns

string

IsCatchAll(string?)

Whether a page pattern is a catch-all ({...}), matching the rest of a path. Only a trailing catch-all is a match, so a literal segment after it can never be satisfied.

public static bool IsCatchAll(string? pattern)

Parameters

pattern string

Returns

bool

MapDynamicSegment(string)

Maps one route-definition segment to its pattern: a star, a bare Remix splat, a bracketed catch-all and an ASP.NET Core catch-all ({rest}, {rest}) become {...}; :name, :name?, [...], $name and an ASP.NET Core parameter ({id}) become {name}; a Vue trailing splat (:rest) and a regex catch-all (:pathMatch(.), :catchAll(.*)) become {...}; a regex-constrained parameter (:id(\d+)) drops the constraint and becomes {id}; anything else is a literal.

public static string MapDynamicSegment(string segment)

Parameters

segment string

Returns

string

Matches(string?, string?)

Whether a concrete path matches an inventory pattern: segment-wise and case-insensitive, where {name} matches exactly one segment and {...} matches the rest of the path, including none.

public static bool Matches(string? pattern, string? path)

Parameters

pattern string
path string

Returns

bool

Normalize(string?)

Normalizes a configured path, a discovered route or a route pattern to the page identity.

public static string? Normalize(string? path)

Parameters

path string

Returns

string

NormalizeRoute(string?)

Normalizes a route definition: like Normalize(string?), but dynamic segments are mapped first, so a Vue :id, a React * and a Next/Nuxt/Remix […] file segment become the same {name} or {...} pattern the inventory matches. An absolute address keeps its scheme and authority; only its path is mapped.

public static string? NormalizeRoute(string? route)

Parameters

route string

Returns

string