MockOgHrefClient constructor

MockOgHrefClient(
  1. Map<Uri, String> contentLinker, {
  2. String contentType = _PLAIN_TEXT_MIME,
})

Simplified parameters for constructing MockOgHrefClient that it only maps Uris with content String under the same contentType which uses text/plain as default.

For setting contentLinker without identical contentType, please uses MockOgHrefClient.advance instead.

Implementation

factory MockOgHrefClient(Map<Uri, String> contentLinker,
        {String contentType = _PLAIN_TEXT_MIME}) =>
    MockOgHrefClient.advance({
      for (var MapEntry(key: url, value: body) in contentLinker.entries)
        url: MockOgHrefClientContent(content: body, contentType: contentType)
    });