JSONFixtureMaker

public protocol JSONFixtureMaker : FixtureMaker

Undocumented

  • Create a JSON Array of models.

    Declaration

    Swift

    func makeJSON(_ number: Int) -> [[String : Any]]

    Parameters

    number

    the number of JSON Object to make.

  • makeJSON(from:) Default implementation

    Create a JSON Array from a sequence of models.

    Default Implementation

    Create a JSON Object from a model.

    Declaration

    Swift

    func makeJSON<S>(from objects: S) -> [[String : Any]] where S : Sequence, Self.Model == S.Element

    Parameters

    objects

    the sequence to use.

  • Create an array of both model and its relative JSON Object.

    Declaration

    Swift

    func makeWithJSON(_ number: Int) -> [(object: Model, JSON: [String : Any])]

    Parameters

    number

    the number of JSON Object/Model to make.

  • makeJSON() Extension method

    Create a JSON Object.

    Declaration

    Swift

    public func makeJSON() -> [String : Any]

    Return Value

    a JSON Object.

  • makeWithJSON() Extension method

    Create a tuple of model and its relative JSON Object.

    Declaration

    Swift

    public func makeWithJSON() -> (object: Model, JSON: [String : Any])

    Return Value

    the tuple of model + JSON Object.