Skip to content

MockLocaleDefinition

ClassMockMagiccom.wetzold.mock-magic
public sealed class MockLocaleDefinition

Project authoring definition. Register takes a frozen copy; later edits do not affect captured profiles.

MockLocaleDefinition(string, string, string)

Section titled “MockLocaleDefinition(string, string, string)”
public MockLocaleDefinition(string id, string displayName, string baseLocaleId = "default")

Creates a project locale definition that inherits an existing profile when registered.

Parameters

NameTypeDescription
idSystem.StringThe profile identifier, without spaces, slashes, backslashes or braces; underscores normalize to hyphens.
displayNameSystem.StringThe nonblank name shown for the profile.
baseLocaleIdSystem.StringThe inherited profile’s identifier or alias, resolved during registration; defaults to default.

SetValues(SimpleDataType, params string[])

Section titled “SetValues(SimpleDataType, params string[])”
public MockLocaleDefinition SetValues(SimpleDataType type, params string[] values)

Provide literal choices for a locale-sensitive string generator.

Parameters

NameType
typeMockMagic.SimpleDataType
valuesSystem.String[]

Returns

MockMagic.MockLocaleDefinition

public MockLocaleDefinition SetLocations(params MockLocaleLocation[] locations)

Replaces this definition’s coherent city, region and postal-code choices with a copied location array.

Parameters

NameTypeDescription
locationsMockMagic.MockLocaleLocation[]A nonempty array of non-null locations, each with a nonblank city.

Returns

MockMagic.MockLocaleDefinition: This definition for chained configuration.

Remarks

Required region and postal-code values are checked against the inherited profile during registration.

public MockLocaleDefinition SetNameOrder(bool familyFirst, string separator = " ")

Overrides the inherited order and separator used to compose full names.

Parameters

NameTypeDescription
familyFirstSystem.BooleanWhether the family name precedes the given name.
separatorSystem.StringThe text between name parts; defaults to a space, and null becomes an empty string.

Returns

MockMagic.MockLocaleDefinition: This definition for chained configuration.

public MockLocaleDefinition WithoutAddresses(string reason = "No complete project address dataset.")

Declare that this project profile has no complete address dataset.

Parameters

NameType
reasonSystem.String

Returns

MockMagic.MockLocaleDefinition

public string Id { get; }

Returns

System.String

public string DisplayName { get; }

Returns

System.String

public string BaseLocaleId { get; }

Returns

System.String