Class RecordingLoader

Namespace
Kuestenlogik.Bowire.Mock.Loading
Assembly
Kuestenlogik.Bowire.Mock.dll

Loads a Bowire recording from disk. Accepts two on-disk shapes:

  • The full recordings-store envelope {"recordings":[...]} as written by ~/.bowire/recordings.json. If the store contains exactly one recording, it is returned; otherwise Load(string, string?) throws unless a name or id is supplied.
  • A single-recording document at the top level — {"id": ..., "steps": [...]} — for mocks that live next to the code they mock.
public static class RecordingLoader
Inheritance
RecordingLoader
Inherited Members

Methods

Load(string, string?)

Parse the given file and return a single recording ready for replay.

public static BowireRecording Load(string path, string? select = null)

Parameters

path string

Absolute or relative path to a recording JSON file.

select string

Optional recording name or id to disambiguate a store with multiple recordings.

Returns

BowireRecording

Parse(string, string?, string)

Same as Load(string, string?) but operates on an in-memory JSON string — used by tests and by the RecordingWatcher when a file change is detected.

public static BowireRecording Parse(string json, string? select = null, string sourceLabel = "<string>")

Parameters

json string
select string
sourceLabel string

Returns

BowireRecording