C# Class Castle.MonoRail.Framework.Test.MockResponse

Represents a mock implementation of IMockResponse for unit test purposes.
Inheritance: IMockResponse
Show file Open project: nats/castle-1.0.3-mono

Public Methods

Method Description
AppendHeader ( string name, string value ) : void

Appends the header.

BinaryWrite ( Stream stream ) : void

Writes the stream to the browser

BinaryWrite ( byte buffer ) : void

Writes the buffer to the browser

Clear ( ) : void

Clears the response (only works if buffered)

ClearContent ( ) : void

Clears the response content (only works if buffered).

CreateCookie ( System.Web.HttpCookie cookie ) : void

Creates a cookie.

CreateCookie ( string name, string value ) : void

Creates a cookie.

CreateCookie ( string name, string value, System.DateTime expiration ) : void

Creates a cookie.

MockResponse ( IDictionary cookies ) : System

Initializes a new instance of the MockResponse class.

Redirect ( string url ) : void

Redirects the specified URL.

Redirect ( string url, bool endProcess ) : void

Redirects the specified URL.

Redirect ( string controller, string action ) : void

Redirects the specified controller.

Redirect ( string area, string controller, string action ) : void

Redirects the specified area.

RemoveCookie ( string name ) : void

Removes a cookie.

Write ( char ch ) : void

Writes the specified char.

Write ( char buffer, int index, int count ) : void

Writes the specified buffer.

Write ( object obj ) : void

Writes the specified obj.

Write ( string s ) : void

Writes the specified string.

WriteFile ( string fileName ) : void

Writes the file.

Private Methods

Method Description
BuildMockUrl ( string area, string controller, string action ) : string

Method Details

AppendHeader() public method

Appends the header.
public AppendHeader ( string name, string value ) : void
name string The name.
value string The value.
return void

BinaryWrite() public method

Writes the stream to the browser
public BinaryWrite ( Stream stream ) : void
stream Stream The stream.
return void

BinaryWrite() public method

Writes the buffer to the browser
public BinaryWrite ( byte buffer ) : void
buffer byte The buffer.
return void

Clear() public method

Clears the response (only works if buffered)
public Clear ( ) : void
return void

ClearContent() public method

Clears the response content (only works if buffered).
public ClearContent ( ) : void
return void

CreateCookie() public method

Creates a cookie.
public CreateCookie ( System.Web.HttpCookie cookie ) : void
cookie System.Web.HttpCookie The cookie.
return void

CreateCookie() public method

Creates a cookie.
public CreateCookie ( string name, string value ) : void
name string The name.
value string The value.
return void

CreateCookie() public method

Creates a cookie.
public CreateCookie ( string name, string value, System.DateTime expiration ) : void
name string The name.
value string The value.
expiration System.DateTime The expiration.
return void

MockResponse() public method

Initializes a new instance of the MockResponse class.
public MockResponse ( IDictionary cookies ) : System
cookies IDictionary The cookies.
return System

Redirect() public method

Redirects the specified URL.
public Redirect ( string url ) : void
url string The URL.
return void

Redirect() public method

Redirects the specified URL.
public Redirect ( string url, bool endProcess ) : void
url string The URL.
endProcess bool if set to true [end process].
return void

Redirect() public method

Redirects the specified controller.
public Redirect ( string controller, string action ) : void
controller string The controller.
action string The action.
return void

Redirect() public method

Redirects the specified area.
public Redirect ( string area, string controller, string action ) : void
area string The area.
controller string The controller.
action string The action.
return void

RemoveCookie() public method

Removes a cookie.
public RemoveCookie ( string name ) : void
name string The name.
return void

Write() public method

Writes the specified char.
public Write ( char ch ) : void
ch char The char.
return void

Write() public method

Writes the specified buffer.
public Write ( char buffer, int index, int count ) : void
buffer char The buffer.
index int The index.
count int The count.
return void

Write() public method

Writes the specified obj.
public Write ( object obj ) : void
obj object The obj.
return void

Write() public method

Writes the specified string.
public Write ( string s ) : void
s string The string.
return void

WriteFile() public method

Writes the file.
public WriteFile ( string fileName ) : void
fileName string Name of the file.
return void