Table of Contents

Class FakeHttpResponseFeature

Namespace
Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features
Assembly
Codebelt.Extensions.Xunit.Hosting.AspNetCore.dll

Represents a way to trigger OnStarting(Func<object, Task>, object).

public class FakeHttpResponseFeature : HttpResponseFeature, IHttpResponseFeature
Inheritance
FakeHttpResponseFeature
Implements
Inherited Members

Constructors

FakeHttpResponseFeature()

Initializes a new instance of the FakeHttpResponseFeature class.

public FakeHttpResponseFeature()

Properties

HasStarted

Indicates if the response has started. If true, the StatusCode, ReasonPhrase, and Headers are now immutable, and OnStarting should no longer be called.

public override bool HasStarted { get; }

Property Value

bool

true if this instance has started; otherwise, false.

Methods

OnStarting(Func<object, Task>, object)

Registers a callback to be invoked just before the response starts. This is the last chance to modify the Headers, StatusCode, or ReasonPhrase.

public override void OnStarting(Func<object, Task> callback, object state)

Parameters

callback Func<object, Task>

The callback to invoke when starting the response.

state object

The state to pass into the callback.

See Also