PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext Class Reference

Provides a fake http context. More...

Inheritance diagram for PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext:
PeanutButter.TestUtils.AspNetCore.Fakes.IFake

Public Member Functions

override void Abort ()
void SetWebSockets (WebSocketManager webSocketManager)
 Sets the websockets manager.
void SetFeatures (IFeatureCollection features)
 Sets the features.
void SetRequestAccessor (Func< HttpRequest > accessor)
 Sets the request accessor.
void SetResponseAccessor (Func< HttpResponse > accessor)
 Sets the response accessor.
void SetConnection (ConnectionInfo connection)
 Sets the connection info.

Properties

bool Aborted [get]
 Indicates if the request has been aborted.
override IFeatureCollection Features [get]
override HttpRequest Request [get]
override HttpResponse Response [get]
override ConnectionInfo Connection [get]
override WebSocketManager WebSockets [get]
override ClaimsPrincipal User [get, set]
override IDictionary< object, object > Items [get, set]
override IServiceProvider RequestServices [get, set]
override CancellationToken RequestAborted = new() [get, set]
override string TraceIdentifier [get, set]
override ISession Session = Guid.NewGuid().ToString() [get, set]

Detailed Description

Provides a fake http context.

Member Function Documentation

◆ SetConnection()

void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.SetConnection ( ConnectionInfo connection)

Sets the connection info.

Parameters
connection

◆ SetFeatures()

void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.SetFeatures ( IFeatureCollection features)

Sets the features.

Parameters
features

◆ SetRequestAccessor()

void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.SetRequestAccessor ( Func< HttpRequest > accessor)

Sets the request accessor.

Parameters
accessor

◆ SetResponseAccessor()

void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.SetResponseAccessor ( Func< HttpResponse > accessor)

Sets the response accessor.

Parameters
accessor

◆ SetWebSockets()

void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.SetWebSockets ( WebSocketManager webSocketManager)

Sets the websockets manager.

Parameters
webSocketManager

Property Documentation

◆ RequestServices

override IServiceProvider PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpContext.RequestServices
getset
Initial value:
= new DefaultDictionary<object, object>(
DefaultDictionaryFlags.ReportMissingKeys
)


The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.AspNetCore/Fakes/FakeHttpContext.cs