MockLocales
public static class MockLocalesBuilt-in locale profiles and project-defined profiles. IDs and aliases are case insensitive.
Methods
Section titled “Methods”
Get(string)
Section titled “Get(string)”public static MockLocale Get(string id)Resolves a registered profile by its case-insensitive identifier or alias.
Parameters
| Name | Type | Description |
|---|---|---|
id | System.String | The 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.
TryGet(string, out MockLocale)
Section titled “TryGet(string, out MockLocale)”public static bool TryGet(string id, out MockLocale locale)Tries to resolve a registered profile by its case-insensitive identifier or alias.
Parameters
| Name | Type | Description |
|---|---|---|
id | System.String | The identifier or alias, with underscores treated as hyphens; null or whitespace selects Default. |
locale | MockMagic.MockLocale | The 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.
Register(MockLocaleDefinition)
Section titled “Register(MockLocaleDefinition)”public static MockLocale Register(MockLocaleDefinition definition)Register an immutable snapshot of a project definition. Built-in IDs and aliases cannot be replaced.
Parameters
| Name | Type |
|---|---|
definition | MockMagic.MockLocaleDefinition |
Returns
MockMagic.MockLocale
Unregister(string)
Section titled “Unregister(string)”public static bool Unregister(string id)Remove a custom registration. Existing scopes, people and streams retain their immutable snapshot.
Parameters
| Name | Type |
|---|---|
id | System.String |
Returns
System.Boolean
Properties
Section titled “Properties”
Default
Section titled “Default”public static MockLocale Default { get; }Returns
MockMagic.MockLocale
public static IReadOnlyList<MockLocale> All { get; }Returns
System.Collections.Generic.IReadOnlyList{MockMagic.MockLocale}