FixtureFactory

public protocol FixtureFactory : FixtureMaker

This protocol specifies the definitions to create an object.

  • The default model definition.

    Declaration

    Swift

    func definition() -> FixtureDefinition<Model>
  • define(locale:_:) Extension method

    Create a new model fixture definition.

    Declaration

    Swift

    public func define(
        locale: String? = Locale.current.languageCode,
        _ definition: @escaping (Faker) -> Model
    ) -> FixtureDefinition<Model>

    Parameters

    locale

    the locale of the faker.

    definition

    the definition closure.

    Return Value

    a new model fixture definition.

  • redefine(locale:_:) Extension method

    Edit the default fixture definition.

    Declaration

    Swift

    public func redefine(
        locale: String? = Locale.current.languageCode,
        _ redefinition: @escaping (Model) -> Model
    ) -> FixtureDefinition<Model>

    Parameters

    locale

    the locale of the faker.

    redefinition

    the redefinition closure.

    Return Value

    a new model fixture definition with the specified edits.

FixtureFactoryMaker

  • make(_:) Extension method

    Declaration

    Swift

    public func make(_ number: Int) -> [Model]