Class MockBucketDerivation

Namespace
Kuestenlogik.Bowire.Mock.State
Assembly
Kuestenlogik.Bowire.Mock.dll

Buckets and CRUD routes a schema makes obvious (#1098). A schema mock's recording carries every operation with its path template and a response synthesised from the schema; where a collection path answers a list and an item path under it, with one id parameter, answers a record of the same shape, that pair is a resource: a bucket seeded with records of the item's shape, and a CRUD route over it.

public static class MockBucketDerivation
Inheritance
MockBucketDerivation
Inherited Members

Remarks

Reading the recording rather than the OpenAPI document keeps this in the mock, independent of which OpenAPI library a host brings. A collection path with a parameter in it (/owners/{ownerId}/pets) is not taken: a CRUD route answers one literal path.

Fields

SeedRecords

How many records a derived bucket starts with.

public const int SeedRecords = 3

Field Value

int

Methods

Derive(IEnumerable<BowireRecordingStep>)

The buckets and routes the recording's resources make obvious, in path order.

public static MockConfiguration Derive(IEnumerable<BowireRecordingStep> steps)

Parameters

steps IEnumerable<BowireRecordingStep>

Returns

MockConfiguration

Merge(MockConfiguration?, MockConfiguration)

The configuration a mock runs with when it also derives buckets: the operator's own buckets and routes as they are, and a derived one only where its name and its path are both still free.

public static MockConfiguration Merge(MockConfiguration? own, MockConfiguration derived)

Parameters

own MockConfiguration
derived MockConfiguration

Returns

MockConfiguration