Table of contents
- 1 Constructors
- 2 Properties
- 3 Methods
- 3.1 GetVirtualDir() : String
- 3.2 GetPhysicalDir() : String
- 3.3 FixtureTerminate()
- 3.4 Terminate()
- 3.5 Initialize()
- 3.6 FixtureInitialize()
- 3.7 ReinstateRequest(Byte[] serializedRequest)
- 3.8 GetSerializedRequest() : Byte[]
- 3.9 DoGet(String path, String[] queryStringParams)
- 3.10 DoGet(String path, Boolean resendCookies, String[] queryStringParams)
- 3.11 DoPost(String path, String[] postStringParams)
- 3.12 DoPost(String path, Boolean resendCookies, String[] postStringParams)
- 3.13 DoHead(String path, String[] postStringParams)
- 3.14 AssertResponseNodeCount(String xpathExpression, Int32 numberOfExpectedNodes)
- 3.15 AssertNotRedirectedTo(String url)
- 3.16 AssertStatusCode(Int32 expectedCode)
- 3.17 AssertSuccess()
- 3.18 AssertReplyEqualTo(String expectedContents)
- 3.19 AssertReplyStartsWith(String contents)
- 3.20 AssertReplyEndsWith(String contents)
- 3.21 AssertReplyContains(String contents)
- 3.22 AssertReplyIsBlank()
- 3.23 AssertReplyMatch(String pattern)
- 3.24 AssertReplyMatch(String pattern, Boolean ignoreSpaces)
- 3.25 AssertReplyMatch(String pattern, Boolean ignoreSpaces, RegexOptions options)
- 3.26 AssertReplyDoesNotContain(String contents)
- 3.27 AssertRedirectedTo(String url)
- 3.28 AssertContentTypeEqualsTo(String expectedContentType)
- 3.29 AssertContentTypeStartsWith(String expectedContentType)
- 3.30 AssertContentTypeEndsWith(String expectedContentType)
- 3.31 AssertHasHeader(String headerName)
- 3.32 AssertPropertyBagContains(String entryKey)
- 3.33 AssertPropertyBagEntryEquals(String entryKey, Object expectedValue)
- 3.34 AssertFlashContains(String entryKey)
- 3.35 AssertFlashDoesNotContain(String entryKey)
- 3.36 AssertFlashEntryEquals(String entryKey, Object expectedValue)
- 3.37 AssertSessionContains(String entryKey)
- 3.38 AssertSessionDoesNotContain(String entryKey)
- 3.39 AssertSessionEntryEqualsTo(String entryKey, Object expectedValue)
- 3.40 AssertHasCookie(String cookieName)
- 3.41 AssertCookieValueEqualsTo(String cookieName, String expectedValue)
- 3.42 AssertCookieExpirationEqualsTo(String cookieName, DateTime expectedExpiration)
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
| Name | Type | Description |
|---|---|---|
| Request | TestRequest | Gets the TestRequest |
| Response | TestResponse | Gets the TestResponse |
| Output | String | Gets the request response |
| SessionId | String | 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.
| Parameter | Description |
|---|---|
| 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");
| Parameter | Description |
|---|---|
| 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");
| Parameter | Description |
|---|---|
| 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");
| Parameter | Description |
|---|---|
| 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");
| Parameter | Description |
|---|---|
| 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");
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| 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.
| Parameter | Description |
|---|---|
| url | Missing documentation |
AssertStatusCode(Int32 expectedCode)
Missing summary
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| expectedContents |
AssertReplyStartsWith(String contents)
Asserts that reply starts with expectedContents
| Parameter | Description |
|---|---|
| contents | Missing documentation |
AssertReplyEndsWith(String contents)
Asserts that reply ends with expectedContents
| Parameter | Description |
|---|---|
| contents | Missing documentation |
AssertReplyContains(String contents)
Asserts that reply contains the specified expectedContents
| Parameter | Description |
|---|---|
| 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
| Parameter | Description |
|---|---|
| pattern | Missing documentation |
AssertReplyMatch(String pattern, Boolean ignoreSpaces)
Asserts that reply contents match the specified pattern pattern
| Parameter | Description |
|---|---|
| pattern | Missing documentation |
| ignoreSpaces | Missing documentation |
AssertReplyMatch(String pattern, Boolean ignoreSpaces, RegexOptions options)
Asserts that reply contents match the specified pattern pattern
| Parameter | Description |
|---|---|
| pattern | Missing documentation |
| ignoreSpaces | Missing documentation |
| options | Missing documentation |
AssertReplyDoesNotContain(String contents)
Asserts that reply does not contain expectedContents
| Parameter | Description |
|---|---|
| contents | Missing documentation |
AssertRedirectedTo(String url)
Asserts that the response was a redirect to the specified url
| Parameter | Description |
|---|---|
| url | Missing documentation |
AssertContentTypeEqualsTo(String expectedContentType)
Asserts that the content-type header is equals to the specified value
| Parameter | Description |
|---|---|
| expectedContentType | value to assert to |
AssertContentTypeStartsWith(String expectedContentType)
Asserts that the content-type header starts with to the specified value
| Parameter | Description |
|---|---|
| expectedContentType | value to assert to |
AssertContentTypeEndsWith(String expectedContentType)
Asserts that the content-type header ends with the specified value
| Parameter | Description |
|---|---|
| expectedContentType | value to assert to |
AssertHasHeader(String headerName)
Asserts that response contains the specified header.
| Parameter | Description |
|---|---|
| headerName | value to assert to |
AssertPropertyBagContains(String entryKey)
Asserts that PropertyBag contains the specified key.
| Parameter | Description |
|---|---|
| entryKey | key name |
AssertPropertyBagEntryEquals(String entryKey, Object expectedValue)
Asserts that PropertyBag's entry value equals to the specified value.
| Parameter | Description |
|---|---|
| entryKey | key name |
| expectedValue | value to assert to |
AssertFlashContains(String entryKey)
Asserts that Flash contains the specified key.
| Parameter | Description |
|---|---|
| entryKey | key name |
AssertFlashDoesNotContain(String entryKey)
Asserts that Flash does not contains the specified key.
| Parameter | Description |
|---|---|
| entryKey | key name |
AssertFlashEntryEquals(String entryKey, Object expectedValue)
Asserts that Flash's entry value equals to the specified value.
| Parameter | Description |
|---|---|
| entryKey | key name |
| expectedValue | value to assert to |
AssertSessionContains(String entryKey)
Asserts that Session contains the specified key.
| Parameter | Description |
|---|---|
| entryKey | key name |
AssertSessionDoesNotContain(String entryKey)
Asserts that Session does not contains the specified key.
| Parameter | Description |
|---|---|
| entryKey | key name |
AssertSessionEntryEqualsTo(String entryKey, Object expectedValue)
Asserts that Session's entry value equals to the specified value.
| Parameter | Description |
|---|---|
| entryKey | key name |
| expectedValue | value to assert to |
AssertHasCookie(String cookieName)
Asserts that the response contains the specified cookie.
| Parameter | Description |
|---|---|
| cookieName | cookie name |
AssertCookieValueEqualsTo(String cookieName, String expectedValue)
Asserts that Response cookie entry value equals to the specified value.
| Parameter | Description |
|---|---|
| cookieName | cookie name |
| expectedValue | value to assert to |
AssertCookieExpirationEqualsTo(String cookieName, DateTime expectedExpiration)
Asserts that the response cookie has the specified expiration.
| Parameter | Description |
|---|---|
| cookieName | cookie name |
| expectedExpiration | value to assert to |