C# 클래스 Subtext.TestLibrary.HttpSimulator

Useful class for simulating the HttpContext. This does not actually make an HttpRequest, it merely simulates the state that your code would be in "as if" handling a request. Thus the HttpContext.Current property is populated.
상속: IDisposable
파일 보기 프로젝트 열기: Tboda/abSee 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

HttpSimulator ( ) : System
HttpSimulator ( string applicationPath ) : System
HttpSimulator ( string applicationPath, string physicalApplicationPath ) : System
SetFormVariable ( string name, string value ) : HttpSimulator

Sets a form variable.

SetHeader ( string name, string value ) : HttpSimulator

Sets a header value.

SetReferer ( Uri referer ) : HttpSimulator

Sets the referer for the request. Uses a fluent interface.

SimulateRequest ( ) : HttpSimulator

Sets up the HttpContext objects to simulate a GET request.

Simulates a request to http://localhost/

SimulateRequest ( Uri url ) : HttpSimulator

Sets up the HttpContext objects to simulate a GET request.

SimulateRequest ( Uri url, HttpVerb httpVerb ) : HttpSimulator

Sets up the HttpContext objects to simulate a request.

SimulateRequest ( Uri url, HttpVerb httpVerb, NameValueCollection headers ) : HttpSimulator

Sets up the HttpContext objects to simulate a request.

SimulateRequest ( Uri url, NameValueCollection formVariables ) : HttpSimulator

Sets up the HttpContext objects to simulate a POST request.

SimulateRequest ( Uri url, NameValueCollection formVariables, NameValueCollection headers ) : HttpSimulator

Sets up the HttpContext objects to simulate a POST request.

보호된 메소드들

메소드 설명
GetHostingEnvironment ( ) : HostingEnvironment
NormalizeSlashes ( string s ) : string
SimulateRequest ( Uri url, HttpVerb httpVerb, NameValueCollection formVariables, NameValueCollection headers ) : HttpSimulator

Sets up the HttpContext objects to simulate a request.

StripPrecedingSlashes ( string s ) : string
StripTrailingBackSlashes ( string s ) : string
StripTrailingSlashes ( string s ) : string

비공개 메소드들

메소드 설명
ExtractQueryStringPart ( Uri url ) : string
InitializeApplication ( ) : void
InitializeSession ( ) : void
ParseRequestUrl ( Uri url ) : void
RightAfter ( string original, string search ) : string
SetHttpRuntimeInternals ( ) : void

메소드 상세

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

GetHostingEnvironment() 보호된 정적인 메소드

protected static GetHostingEnvironment ( ) : HostingEnvironment
리턴 System.Web.Hosting.HostingEnvironment

HttpSimulator() 공개 메소드

public HttpSimulator ( ) : System
리턴 System

HttpSimulator() 공개 메소드

public HttpSimulator ( string applicationPath ) : System
applicationPath string
리턴 System

HttpSimulator() 공개 메소드

public HttpSimulator ( string applicationPath, string physicalApplicationPath ) : System
applicationPath string
physicalApplicationPath string
리턴 System

NormalizeSlashes() 보호된 정적인 메소드

protected static NormalizeSlashes ( string s ) : string
s string
리턴 string

SetFormVariable() 공개 메소드

Sets a form variable.
public SetFormVariable ( string name, string value ) : HttpSimulator
name string
value string
리턴 HttpSimulator

SetHeader() 공개 메소드

Sets a header value.
public SetHeader ( string name, string value ) : HttpSimulator
name string
value string
리턴 HttpSimulator

SetReferer() 공개 메소드

Sets the referer for the request. Uses a fluent interface.
public SetReferer ( Uri referer ) : HttpSimulator
referer System.Uri
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a GET request.
Simulates a request to http://localhost/
public SimulateRequest ( ) : HttpSimulator
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a GET request.
public SimulateRequest ( Uri url ) : HttpSimulator
url System.Uri
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a request.
public SimulateRequest ( Uri url, HttpVerb httpVerb ) : HttpSimulator
url System.Uri
httpVerb HttpVerb
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a request.
public SimulateRequest ( Uri url, HttpVerb httpVerb, NameValueCollection headers ) : HttpSimulator
url System.Uri
httpVerb HttpVerb
headers System.Collections.Specialized.NameValueCollection
리턴 HttpSimulator

SimulateRequest() 보호된 메소드

Sets up the HttpContext objects to simulate a request.
protected SimulateRequest ( Uri url, HttpVerb httpVerb, NameValueCollection formVariables, NameValueCollection headers ) : HttpSimulator
url System.Uri
httpVerb HttpVerb
formVariables System.Collections.Specialized.NameValueCollection
headers System.Collections.Specialized.NameValueCollection
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a POST request.
public SimulateRequest ( Uri url, NameValueCollection formVariables ) : HttpSimulator
url System.Uri
formVariables System.Collections.Specialized.NameValueCollection
리턴 HttpSimulator

SimulateRequest() 공개 메소드

Sets up the HttpContext objects to simulate a POST request.
public SimulateRequest ( Uri url, NameValueCollection formVariables, NameValueCollection headers ) : HttpSimulator
url System.Uri
formVariables System.Collections.Specialized.NameValueCollection
headers System.Collections.Specialized.NameValueCollection
리턴 HttpSimulator

StripPrecedingSlashes() 보호된 정적인 메소드

protected static StripPrecedingSlashes ( string s ) : string
s string
리턴 string

StripTrailingBackSlashes() 보호된 정적인 메소드

protected static StripTrailingBackSlashes ( string s ) : string
s string
리턴 string

StripTrailingSlashes() 보호된 정적인 메소드

protected static StripTrailingSlashes ( string s ) : string
s string
리턴 string