Skip to content

MockLocales

ClassMockMagiccom.wetzold.mock-magic
public static class MockLocales

Built-in locale profiles and project-defined profiles. IDs and aliases are case insensitive.

public static MockLocale Get(string id)

Resolves a registered profile by its case-insensitive identifier or alias.

Parameters

NameTypeDescription
idSystem.StringThe identifier or alias, with underscores treated as hyphens; null or whitespace selects Default.

Returns

MockMagic.MockLocale: The matching built-in or project-registered locale profile.

public static bool TryGet(string id, out MockLocale locale)

Tries to resolve a registered profile by its case-insensitive identifier or alias.

Parameters

NameTypeDescription
idSystem.StringThe identifier or alias, with underscores treated as hyphens; null or whitespace selects Default.
localeMockMagic.MockLocaleThe matching profile on success, or null when the identifier is unknown.

Returns

System.Boolean: True when the identifier or alias resolves to a registered profile; otherwise false.

public static MockLocale Register(MockLocaleDefinition definition)

Register an immutable snapshot of a project definition. Built-in IDs and aliases cannot be replaced.

Parameters

NameType
definitionMockMagic.MockLocaleDefinition

Returns

MockMagic.MockLocale

public static bool Unregister(string id)

Remove a custom registration. Existing scopes, people and streams retain their immutable snapshot.

Parameters

NameType
idSystem.String

Returns

System.Boolean

public static MockLocale Default { get; }

Returns

MockMagic.MockLocale

public static IReadOnlyList<MockLocale> All { get; }

Returns

System.Collections.Generic.IReadOnlyList{MockMagic.MockLocale}