Home

Castle Stronghold

Table of contents

AbstractMRTestCase API Document

Base class for tests cases using the ASP.Net Runtime to run the web project

Constructors

AbstractMRTestCase()

Initializes a new instance of the Castle.MonoRail.TestSupport.AbstractMRTestCase class.

Properties

NameTypeDescription
RequestTestRequest Gets the TestRequest
ResponseTestResponse Gets the TestResponse
OutputString Gets the request response
SessionIdString Returns the sessionId related to the current session

Methods

GetVirtualDir() : String

Missing summary

GetPhysicalDir() : String

Missing summary

FixtureTerminate()

Missing summary

Terminate()

Missing summary

Initialize()

Missing summary

FixtureInitialize()

Missing summary

ReinstateRequest(Byte[] serializedRequest)

Reinstates the request.

ParameterDescription
serializedRequest The serialized request.

GetSerializedRequest() : Byte[]

Gets the serialized request.

DoGet(String path, String[] queryStringParams)

Performs a GET operation on the specified path.

Example


DoGet("home/index.rails");

ParameterDescription
path The resource being request, for example home/index.rails
queryStringParams A list of key/value pair, for example name=johndoe

DoGet(String path, Boolean resendCookies, String[] queryStringParams)

Performs a GET operation on the specified path.

Example


DoGet("home/index.rails");

ParameterDescription
path The resource being request, for example home/index.rails
resendCookies if set to true [resend cookies].
queryStringParams A list of key/value pair, for example name=johndoe

DoPost(String path, String[] postStringParams)

Performs a POST operation on the specified path.

Example


DoPost("producto/search.rails", "name=mac", "page=1");

ParameterDescription
path The resource being request, for example home/index.rails
postStringParams A list of key/value pair, for example name=johndoe

DoPost(String path, Boolean resendCookies, String[] postStringParams)

Performs a POST operation on the specified path.

Example


DoPost("producto/search.rails", "name=mac", "page=1");

ParameterDescription
path The resource being request, for example home/index.rails
resendCookies if set to true [resend cookies].
postStringParams A list of key/value pair, for example name=johndoe

DoHead(String path, String[] postStringParams)

Performs a HEAD operation on the specified path.

Example


DoHead("producto/search.rails", "name=mac", "page=1");

ParameterDescription
path The resource being request, for example home/index.rails
postStringParams A list of key/value pair, for example name=johndoe

AssertResponseNodeCount(String xpathExpression, Int32 numberOfExpectedNodes)

Asserts that the response contains a number of nodes matching an XPath expression.

ParameterDescription
xpathExpression The xpath expression to match against.
numberOfExpectedNodes The number of expected nodes.

AssertNotRedirectedTo(String url)

Asserts that the response was NOT a redirect to the specified url - for example check that your request was not sent to a login screen.

ParameterDescription
url Missing documentation

AssertStatusCode(Int32 expectedCode)

Missing summary

ParameterDescription
expectedCode Missing documentation

AssertSuccess()

Asserts the return status code is less than 400

AssertReplyEqualTo(String expectedContents)

Asserts that reply has exactly the samme content of expectedContents

ParameterDescription
expectedContents

AssertReplyStartsWith(String contents)

Asserts that reply starts with expectedContents

ParameterDescription
contents Missing documentation

AssertReplyEndsWith(String contents)

Asserts that reply ends with expectedContents

ParameterDescription
contents Missing documentation

AssertReplyContains(String contents)

Asserts that reply contains the specified expectedContents

ParameterDescription
contents Missing documentation

AssertReplyIsBlank()

Asserts that reply have only whitespace characters

AssertReplyMatch(String pattern)

Asserts that reply contents match the specified pattern, ignoring any whitespaces pattern

ParameterDescription
pattern Missing documentation

AssertReplyMatch(String pattern, Boolean ignoreSpaces)

Asserts that reply contents match the specified pattern pattern

ParameterDescription
pattern Missing documentation
ignoreSpaces Missing documentation

AssertReplyMatch(String pattern, Boolean ignoreSpaces, RegexOptions options)

Asserts that reply contents match the specified pattern pattern

ParameterDescription
pattern Missing documentation
ignoreSpaces Missing documentation
options Missing documentation

AssertReplyDoesNotContain(String contents)

Asserts that reply does not contain expectedContents

ParameterDescription
contents Missing documentation

AssertRedirectedTo(String url)

Asserts that the response was a redirect to the specified url

ParameterDescription
url Missing documentation

AssertContentTypeEqualsTo(String expectedContentType)

Asserts that the content-type header is equals to the specified value

ParameterDescription
expectedContentType value to assert to

AssertContentTypeStartsWith(String expectedContentType)

Asserts that the content-type header starts with to the specified value

ParameterDescription
expectedContentType value to assert to

AssertContentTypeEndsWith(String expectedContentType)

Asserts that the content-type header ends with the specified value

ParameterDescription
expectedContentType value to assert to

AssertHasHeader(String headerName)

Asserts that response contains the specified header.

ParameterDescription
headerName value to assert to

AssertPropertyBagContains(String entryKey)

Asserts that PropertyBag contains the specified key.

ParameterDescription
entryKey key name

AssertPropertyBagEntryEquals(String entryKey, Object expectedValue)

Asserts that PropertyBag's entry value equals to the specified value.

ParameterDescription
entryKey key name
expectedValue value to assert to

AssertFlashContains(String entryKey)

Asserts that Flash contains the specified key.

ParameterDescription
entryKey key name

AssertFlashDoesNotContain(String entryKey)

Asserts that Flash does not contains the specified key.

ParameterDescription
entryKey key name

AssertFlashEntryEquals(String entryKey, Object expectedValue)

Asserts that Flash's entry value equals to the specified value.

ParameterDescription
entryKey key name
expectedValue value to assert to

AssertSessionContains(String entryKey)

Asserts that Session contains the specified key.

ParameterDescription
entryKey key name

AssertSessionDoesNotContain(String entryKey)

Asserts that Session does not contains the specified key.

ParameterDescription
entryKey key name

AssertSessionEntryEqualsTo(String entryKey, Object expectedValue)

Asserts that Session's entry value equals to the specified value.

ParameterDescription
entryKey key name
expectedValue value to assert to

AssertHasCookie(String cookieName)

Asserts that the response contains the specified cookie.

ParameterDescription
cookieName cookie name

AssertCookieValueEqualsTo(String cookieName, String expectedValue)

Asserts that Response cookie entry value equals to the specified value.

ParameterDescription
cookieName cookie name
expectedValue value to assert to

AssertCookieExpirationEqualsTo(String cookieName, DateTime expectedExpiration)

Asserts that the response cookie has the specified expiration.

ParameterDescription
cookieName cookie name
expectedExpiration value to assert to

Google
Search WWW Search castleproject.org