C# Class HttpMock.RequestHandler

Inheritance: IRequestHandler, IRequestStub
Show file Open project: hibri/HttpMock Class Usage Examples

Public Methods

Method Description
AddHeader ( string header, string headerValue ) : IRequestStub
AsContentType ( string contentType ) : IRequestStub
AsXmlContent ( ) : IRequestStub
CanVerifyConstraintsFor ( string url ) : bool
GetBody ( ) : string
LastRequest ( ) : HttpMock.ReceivedRequest
NotFound ( ) : void
OK ( ) : void
RecordRequest ( HttpRequestHead request, string body ) : void
RequestCount ( ) : int
RequestHandler ( string path, IRequestProcessor requestProcessor ) : System
Return ( Func responseBody ) : IRequestStub
Return ( string responseBody ) : IRequestStub
ReturnFile ( string pathToFile ) : IRequestStub
ReturnFileRange ( string pathToFile, int from, int to ) : IRequestStub
ToString ( ) : string
WithParams ( string>.IDictionary nameValueCollection ) : IRequestStub
WithStatus ( HttpStatusCode httpStatusCode ) : void
WithUrlConstraint ( bool>.Func constraint ) : IRequestStub

Method Details

AddHeader() public method

public AddHeader ( string header, string headerValue ) : IRequestStub
header string
headerValue string
return IRequestStub

AsContentType() public method

public AsContentType ( string contentType ) : IRequestStub
contentType string
return IRequestStub

AsXmlContent() public method

public AsXmlContent ( ) : IRequestStub
return IRequestStub

CanVerifyConstraintsFor() public method

public CanVerifyConstraintsFor ( string url ) : bool
url string
return bool

GetBody() public method

public GetBody ( ) : string
return string

LastRequest() public method

public LastRequest ( ) : HttpMock.ReceivedRequest
return HttpMock.ReceivedRequest

NotFound() public method

public NotFound ( ) : void
return void

OK() public method

public OK ( ) : void
return void

RecordRequest() public method

public RecordRequest ( HttpRequestHead request, string body ) : void
request HttpRequestHead
body string
return void

RequestCount() public method

public RequestCount ( ) : int
return int

RequestHandler() public method

public RequestHandler ( string path, IRequestProcessor requestProcessor ) : System
path string
requestProcessor IRequestProcessor
return System

Return() public method

public Return ( Func responseBody ) : IRequestStub
responseBody Func
return IRequestStub

Return() public method

public Return ( string responseBody ) : IRequestStub
responseBody string
return IRequestStub

ReturnFile() public method

public ReturnFile ( string pathToFile ) : IRequestStub
pathToFile string
return IRequestStub

ReturnFileRange() public method

public ReturnFileRange ( string pathToFile, int from, int to ) : IRequestStub
pathToFile string
from int
to int
return IRequestStub

ToString() public method

public ToString ( ) : string
return string

WithParams() public method

public WithParams ( string>.IDictionary nameValueCollection ) : IRequestStub
nameValueCollection string>.IDictionary
return IRequestStub

WithStatus() public method

public WithStatus ( HttpStatusCode httpStatusCode ) : void
httpStatusCode HttpStatusCode
return void

WithUrlConstraint() public method

public WithUrlConstraint ( bool>.Func constraint ) : IRequestStub
constraint bool>.Func
return IRequestStub