Table of Contents

Interface IStreamSubstitution

Namespace
Fluxzy.Core
Assembly
Fluxzy.Core.dll

Low level interface to substitute a request or response body. Provided an implementation of this interface to ExchangeContext in order to substitute a request or response body.

public interface IStreamSubstitution

Methods

Substitute(Stream)

This class is used to low level-mock request and response body. Even if this class is async for fast mocking purpose, calling async in the implementation will lead to unnecessary overhead. Additionally, you must drain (read to EOF) the provided stream in order to not hang the remote connection when the original stream is coming from a remote connection.

ValueTask<Stream> Substitute(Stream originalStream)

Parameters

originalStream Stream

The original stream (must be drained and disposed)

Returns

ValueTask<Stream>

The stream that will be send to the client