JustDummies

Juste des dummies, mais redoutablement efficaces.

API v1.0.0-preview.6

Sections de l'API

URI

Toutes les familles d'URI que la bibliothèque sait tirer, chacune réduite aux seuls composants que cette famille possède réellement.

Les signatures et les commentaires de documentation ci-dessous restent en anglais sur toutes les pages, dans toutes les locales : ils sont lus directement dans les paquets publiés, et non écrits pour ce site.

sealed class

AnyFtpUri

A generator of arbitrary ftp URIs — the classic ftp://user:password@host/path shape of legacy code. An FTP URI carries user-info but no query and no fragment, so this builder does not expose them.

public sealed class AnyFtpUri
Implémente
IAny<Uri>

Méthodes

AnyFtpUri WithHost(string host)Pins the host. Must be an ASCII host name (pass the punycode form for internationalized hosts).
AnyFtpUri WithUserInfo()Includes arbitrary user:password user-info.
AnyFtpUri WithUserInfo(string user)Includes user-info with the given user and an arbitrary password.
AnyFtpUri WithUserInfo(string user, string password)Includes the given user and password user-info.
AnyFtpUri WithPort()Includes an arbitrary non-default port.
AnyFtpUri WithPort(int port)Includes the given port.
AnyFtpUri WithPathSegments(int count)Fixes the path to exactly count segments. Declared once per generator.
AnyFtpUri WithoutPath()Renders the root path (/) with no segments. Declared once per generator.
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyMailtoUri

A generator of arbitrary mailto URIs — mailto:local@domain, optionally with headers. The local-part and domain are drawn from ASCII characters, so the value is an arbitrary well-formed address, never a realistic one (this library does not fabricate plausible data). A mailto URI is not authority-based, so this builder exposes no host/port/user-info in the authority sense — only the address parts and headers.

public sealed class AnyMailtoUri
Implémente
IAny<Uri>

Méthodes

AnyMailtoUri WithLocalPart(string localPart)Pins the local-part (the text before @).
AnyMailtoUri WithDomain(string domain)Pins the domain (the text after @). Must be an ASCII host name.
AnyMailtoUri WithHeaders()Includes an arbitrary header (e.g. ?subject=...).
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyRelativeUri

A generator of arbitrary relative URI references — a path with an optional query and fragment, and no scheme or authority (e.g. orders/42?page=2 or /a/b/c#top). A relative reference is well-formed on its own; only its resolution against a base needs a base, not its validity. Generate returns a Uri with IsAbsoluteUri false.

public sealed class AnyRelativeUri
Implémente
IAny<Uri>

Méthodes

AnyRelativeUri Rooted()Starts the path with / (an absolute-path reference).
AnyRelativeUri WithPathSegments(int count)Fixes the path to exactly count segments. Declared once per generator.
AnyRelativeUri WithQuery()Includes an arbitrary query string.
AnyRelativeUri WithFragment()Includes an arbitrary fragment.
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyUri

A fluent generator of arbitrary yet valid Uri values. Unconstrained, it spans the whole safe URI space — an absolute web (http/https), WebSocket (ws/wss), FTP or mailto URI, or a relative reference — drawn from the ambient random context. Narrow it to one family to reach that family's constraints: each narrowing returns a family-specific builder that exposes only the components that family actually has, so an impossible combination (a port on a mailto, a fragment on a WebSocket) cannot even be written.

public sealed class AnyUri
Implémente
IAny<Uri>

Construit via

static AnyUri Any.Uri()Starts an arbitrary Uri generator drawing from the ambient random context. Unconstrained, it yields any valid URI from the safe space — an absolute web (http/https), WebSocket (ws/wss), FTP or mailto URI, or a relative reference. Narrow it to a family (Web(), WebSocket(), Ftp(), Mailto(), Relative()) to reach that family's component constraints; each narrowing returns a builder exposing only that family's valid components.

Méthodes

AnyWebUri Web()Narrows to a web URI: http or https, with the full authority surface.
AnyWebSocketUri WebSocket()Narrows to a WebSocket URI: ws or wss (no user-info, no fragment — RFC 6455).
AnyFtpUri Ftp()Narrows to an ftp URI (authority with user-info, no query or fragment).
AnyMailtoUri Mailto()Narrows to a mailto URI: local@domain, optionally with headers.
AnyRelativeUri Relative()Narrows to a relative reference: a path with an optional query and fragment, no scheme or authority.
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyWebSocketUri

A generator of arbitrary ws/wss URIs. Per RFC 6455 a WebSocket URI carries no user-info and no fragment, so — unlike AnyWebUri — this builder does not expose them. Pin the TLS variant with UsingWs/UsingWss; unpinned, the scheme is drawn from both.

public sealed class AnyWebSocketUri
Implémente
IAny<Uri>

Méthodes

AnyWebSocketUri UsingWs()Pins the scheme to ws. Declared once per generator.
AnyWebSocketUri UsingWss()Pins the scheme to wss. Declared once per generator.
AnyWebSocketUri WithHost(string host)Pins the host. Must be an ASCII host name (pass the punycode form for internationalized hosts).
AnyWebSocketUri WithPort()Includes an arbitrary non-default port.
AnyWebSocketUri WithPort(int port)Includes the given port.
AnyWebSocketUri WithPathSegments(int count)Fixes the path to exactly count segments. Declared once per generator.
AnyWebSocketUri WithoutPath()Renders the root path (/) with no segments. Declared once per generator.
AnyWebSocketUri WithQuery()Includes an arbitrary query string.
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyWebUri

A generator of arbitrary http/https URIs. Exposes the full authority surface — user-info, host, port, path, query and fragment. Pin the TLS variant with UsingHttp/UsingHttps; unpinned, the scheme is drawn from both. Every component is drawn from ASCII-unreserved characters, so a value is valid by construction and reproducible under a seed.

public sealed class AnyWebUri
Implémente
IAny<Uri>

Méthodes

AnyWebUri UsingHttp()Pins the scheme to http. Declared once per generator.
AnyWebUri UsingHttps()Pins the scheme to https. Declared once per generator.
AnyWebUri WithHost(string host)Pins the host. Must be an ASCII host name (pass the punycode form for internationalized hosts).
AnyWebUri WithUserInfo()Includes arbitrary user:password user-info.
AnyWebUri WithUserInfo(string user)Includes user-info with the given user and an arbitrary password.
AnyWebUri WithUserInfo(string user, string password)Includes the given user and password user-info.
AnyWebUri WithPort()Includes an arbitrary non-default port.
AnyWebUri WithPort(int port)Includes the given port.
AnyWebUri WithPathSegments(int count)Fixes the path to exactly count segments. Declared once per generator.
AnyWebUri WithoutPath()Renders the root path (/) with no segments. Declared once per generator.
AnyWebUri WithQuery()Includes an arbitrary query string.
AnyWebUri WithFragment()Includes an arbitrary fragment.
Uri Generate()Produces one arbitrary value satisfying every constraint declared on this generator.