Table of Contents

Class FakeHttpResponseFeature

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

Represents a way to trigger Microsoft.AspNetCore.Http.Features.HttpResponseFeature.OnStarting(System.Func<System.Object, System.Threading.Tasks.Task>, System.Object).

public class FakeHttpResponseFeature : HttpResponseFeature, IHttpResponseFeature
Inheritance
Object
HttpResponseFeature
FakeHttpResponseFeature
Implements
IHttpResponseFeature
Inherited Members
HttpResponseFeature.OnCompleted(Func<Object, Task>, Object)
HttpResponseFeature.StatusCode
HttpResponseFeature.ReasonPhrase
HttpResponseFeature.Headers
HttpResponseFeature.Body

Constructors

FakeHttpResponseFeature()

Initializes a new instance of the FakeHttpResponseFeature class.

public FakeHttpResponseFeature()

Properties

HasStarted

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

public override bool HasStarted { get; }

Property Value

Boolean

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 Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.Headers, Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.StatusCode, or Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.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

HttpResponseFeature