NUnit.Extensions.Asp

NUnitAsp

NUnit.Extensions.Asp Namespace

Classes

Class | Description
ControlDisabledException | Exception: The test is trying to perform a UI operation on a disabled control. Enable the control in your production code or don't change it in the test.
ControlTester | Base class for all tag-based controls. Most people should extend AspControlTester or HtmlControlTester. The API for this class will change in future releases.
DoctypeDtdException | Problems with the DOCTYPE DTD; probably that it was incorrect. Correct it.
FormVariables | A collection of HTML form variables. These form variables are sent to the server when you submit or postback a form. They consist of a name/value pair and are not required to be unique. You may include duplicate names or even duplicate name/value pairs in this collection. When writing custom testers, ReplaceAll and RemoveAll are typically the most appropriate methods to use.
HtmlTagTester

An HTML tag. This class performs some of the magic that allows NUnitAsp to construct testers before pages are loaded and to have testers change as the current page changes.

When using the methods on this class, check the API documentation before caching the results. The API of this class may change in future releases.

HtmlTagTester.ElementNotVisibleException
HtmlTagTester.NoHtmlIdException
HttpClient | A web client, capable of communicating with a web server.
HttpClient.AspServerException | Exception: The requested URL caused an unhandled exception on the ASP.NET server. Fix the production code so it doesn't throw the exception.
HttpClient.BadStatusException | Exception: The server returned an unexpected status code. Determine what's wrong with the server.
HttpClient.NoPageException | Exception: A request has been made that requires a page to have been loaded, but no page has been loaded yet. Call GetPage() before calling the method that threw this exception.
HttpClient.NotFoundException | Exception: The requested URL was not found. Correct the URL or determine what's wrong with the server.
HttpClient.RedirectLoopException | Exception: Too many HTTP redirects were detected. Check for infinite redirection loop.
ParseException | Exception: The tester has a bug: it was looking for some HTML and didn't find it. Report this exception to the author of the tester.
Tester

Base class for all NUnitAsp testers. To create your own tester classes, you should usually extend AspControlTester or HtmlControlTester instead.

Not intended for third-party use. The API for this class will change in future releases. Currently, this class assumes that every tester corresponds to exactly one tag in the web page. That may change in the future.

Tester.AttributeMissingException
WebAssert | Assertions specific to NUnitAsp's web testers.
WebAssertionException | An assumption was violated, either in your tests or in NUnitAsp itself. When you get this exception, look at the exception message for more information.
WebForm | Obsolete; use WebFormTester instead.
WebFormTester

A tester for an ASP.NET form. Most of the methods in this class aren't meant to be called by third parties.

The API for this class will change in future releases.

Enumerations

Enumeration | Description
DataType | The data type of a column (use with AssertSortOrder)


ControlDisabledException Class

Exception: The test is trying to perform a UI operation on a disabled control. Enable the control in your production code or don't change it in the test.

For a list of all members of this type, see ControlDisabledException Members.

System.Object
Exception
SystemException
InvalidOperationException
ControlDisabledException

public class ControlDisabledException : InvalidOperationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ControlDisabledException Members | NUnit.Extensions.Asp Namespace


ControlDisabledException Members

ControlDisabledException overview

Public Instance Constructors

ControlDisabledException Constructor

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ControlDisabledException Class | NUnit.Extensions.Asp Namespace


ControlDisabledException Constructor

public ControlDisabledException(
ControlTester control
);

See Also

ControlDisabledException Class | NUnit.Extensions.Asp Namespace


ControlTester Class

Base class for all tag-based controls. Most people should extend AspControlTester or HtmlControlTester. The API for this class will change in future releases.

For a list of all members of this type, see ControlTester Members.

System.Object
Tester
ControlTester

public abstract class ControlTester : Tester

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ControlTester Members | NUnit.Extensions.Asp Namespace


ControlTester Members

ControlTester overview

Public Instance Constructors

ControlTester Overloaded. Initializes a new instance of the ControlTester class.

Public Instance Properties

AspId | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
HtmlId | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Constructors

ControlTester Overloaded. Initializes a new instance of the ControlTester class.

Protected Instance Properties

IsDisabled | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser | The browser instance used to load the page containing the form being tested.
Form | The form containing this control

Protected Internal Instance Methods

EnterInputValue |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue |
Submit | Post the form containing this control to the server.

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester Constructor

Create a tester that has no ID. This constructor is for NUnitAsp internal use and should be avoided. It will likely change in a future release.

Overload List

Create a tester that has no ID. This constructor is for NUnitAsp internal use and should be avoided. It will likely change in a future release.

protected ControlTester();

Create a tester that has no ID. This constructor is for NUnitAsp internal use and should be avoided. It will likely change in a future release.

protected ControlTester(Tester);

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ControlTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ControlTester(string,Tester);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester Constructor ()

Create a tester that has no ID. This constructor is for NUnitAsp internal use and should be avoided. It will likely change in a future release.

protected ControlTester();

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester Constructor Overload List


ControlTester Constructor (Tester)

Create a tester that has no ID. This constructor is for NUnitAsp internal use and should be avoided. It will likely change in a future release.

protected ControlTester(
Tester container
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester Constructor Overload List


ControlTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ControlTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester Constructor Overload List


ControlTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebFormTester webForm = new WebFormTester(myHttpClient);
            LabelTester myTester = new LabelTester("id", webForm);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester Constructor Overload List


ControlTester Properties

The properties of the ControlTester class are listed below. For a complete list of ControlTester class members, see the ControlTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
HtmlId | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser | The browser instance used to load the page containing the form being tested.
Form | The form containing this control

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.AspId Property

The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.

public override string AspId {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.Browser Property

The browser instance used to load the page containing the form being tested.

protected internal override HttpClient Browser {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.Description Property

A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.

public override string Description {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.Form Property

The form containing this control

protected internal override WebFormTester Form {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.HtmlId Property

The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.

public override string HtmlId {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.HtmlIdAndDescription Property

A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.

public override string HtmlIdAndDescription {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.IsDisabled Property

True if the control is disabled.

protected virtual bool IsDisabled {get;}

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester Methods

The methods of the ControlTester class are listed below. For a complete list of ControlTester class members, see the ControlTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue |
Submit | Post the form containing this control to the server.

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.EnterInputValue Method

protected internal void EnterInputValue(
string name,
string value
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.GetChildElementHtmlId Method

Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

protected internal override string GetChildElementHtmlId(
string aspId
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.IsPostBack Method

Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.

protected bool IsPostBack(
string candidatePostBackScript
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.OptionalPostBack Method

Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.

protected void OptionalPostBack(
string candidatePostBackScript
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


PostBack Method

NUnitAsp

ControlTester.PostBack Method

Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Overload List

Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

protected void PostBack(string);

Trigger a post-back. If you don't have a post-back script but need to trigger a post-back, call this method with the appropriate event target and argument.

protected void PostBack(string,string);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.PostBack Method (String)

Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

protected void PostBack(
string postBackScript
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester.PostBack Overload List


ControlTester.PostBack Method (String, String)

Trigger a post-back. If you don't have a post-back script but need to trigger a post-back, call this method with the appropriate event target and argument.

protected void PostBack(
string eventTarget,
string eventArgument
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace | ControlTester.PostBack Overload List


ControlTester.RemoveInputValue Method

protected internal void RemoveInputValue(
string name
);

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


ControlTester.Submit Method

Post the form containing this control to the server.

protected internal virtual void Submit();

See Also

ControlTester Class | NUnit.Extensions.Asp Namespace


DataType Enumeration

The data type of a column (use with AssertSortOrder)

public enum DataType

Members

Member Name | Description
String |
DateTime |
Int |

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

NUnit.Extensions.Asp Namespace


DoctypeDtdException Class

Problems with the DOCTYPE DTD; probably that it was incorrect. Correct it.

For a list of all members of this type, see DoctypeDtdException Members.

System.Object
Exception
ApplicationException
DoctypeDtdException

public class DoctypeDtdException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

DoctypeDtdException Members | NUnit.Extensions.Asp Namespace


DoctypeDtdException Members

DoctypeDtdException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

DoctypeDtdException Class | NUnit.Extensions.Asp Namespace


FormVariables Class

A collection of HTML form variables. These form variables are sent to the server when you submit or postback a form. They consist of a name/value pair and are not required to be unique. You may include duplicate names or even duplicate name/value pairs in this collection. When writing custom testers, ReplaceAll and RemoveAll are typically the most appropriate methods to use.

For a list of all members of this type, see FormVariables Members.

System.Object
FormVariables

public class FormVariables

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

FormVariables Members | NUnit.Extensions.Asp Namespace


FormVariables Members

FormVariables overview

Public Instance Constructors

FormVariables Constructor Initializes a new instance of the FormVariables class.

Public Instance Methods

Add | Add a name/value pair. Add doesn't overwrite any existing pairs with the same name, so in most cases, ReplaceAll is more appropriate.
AllValuesOf | Returns all the values associated with the specified name. Returns an empty (zero-length) array if there aren't any. ValueOf is more convenient when there's exactly one name/value pair with the specified name.
Contains | Check if a name/value pair is in the collection. It could exist more than once.
ContainsAny | Check if a particular name has any values. There could be more than one name/value pair with the specified name.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Remove | Remove a specific name/value pair. If the pair is in the collection more than once, this method will only remove one of them.
RemoveAll | Remove all form variables with a particular name.
Replace | Replace a specific name/value pair.
ReplaceAll | Replace all form variables with a particular name. This is the same as calling RemoveAll and then Add.
ToString | Serializes all the name/value pairs into a string. The format of the string matches the HTTP protocol specification for transmitting form variables to a server. This can be handy for checking the form variables in your web page. Generally you won't be sending it to a server because HttpClient handles that for you.
ValueOf | Returns the value of the name/value pair with the specified name. Throws an exception if there aren't any pairs with that name or if there's more than one. Use AllValuesOf to handle cases where there isn't exactly one name/value pair with the requested name.

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables Constructor

Initializes a new instance of the FormVariables class.

public FormVariables();

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables Methods

The methods of the FormVariables class are listed below. For a complete list of FormVariables class members, see the FormVariables Members topic.

Public Instance Methods

Add | Add a name/value pair. Add doesn't overwrite any existing pairs with the same name, so in most cases, ReplaceAll is more appropriate.
AllValuesOf | Returns all the values associated with the specified name. Returns an empty (zero-length) array if there aren't any. ValueOf is more convenient when there's exactly one name/value pair with the specified name.
Contains | Check if a name/value pair is in the collection. It could exist more than once.
ContainsAny | Check if a particular name has any values. There could be more than one name/value pair with the specified name.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Remove | Remove a specific name/value pair. If the pair is in the collection more than once, this method will only remove one of them.
RemoveAll | Remove all form variables with a particular name.
Replace | Replace a specific name/value pair.
ReplaceAll | Replace all form variables with a particular name. This is the same as calling RemoveAll and then Add.
ToString | Serializes all the name/value pairs into a string. The format of the string matches the HTTP protocol specification for transmitting form variables to a server. This can be handy for checking the form variables in your web page. Generally you won't be sending it to a server because HttpClient handles that for you.
ValueOf | Returns the value of the name/value pair with the specified name. Throws an exception if there aren't any pairs with that name or if there's more than one. Use AllValuesOf to handle cases where there isn't exactly one name/value pair with the requested name.

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.Add Method

Add a name/value pair. Add doesn't overwrite any existing pairs with the same name, so in most cases, ReplaceAll is more appropriate.

public void Add(
string name,
string value
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.AllValuesOf Method

Returns all the values associated with the specified name. Returns an empty (zero-length) array if there aren't any. ValueOf is more convenient when there's exactly one name/value pair with the specified name.

public string[] AllValuesOf(
string name
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.Contains Method

Check if a name/value pair is in the collection. It could exist more than once.

public bool Contains(
string name,
string value
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.ContainsAny Method

Check if a particular name has any values. There could be more than one name/value pair with the specified name.

public bool ContainsAny(
string name
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.Remove Method

Remove a specific name/value pair. If the pair is in the collection more than once, this method will only remove one of them.

public void Remove(
string name,
string value
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.RemoveAll Method

Remove all form variables with a particular name.

public void RemoveAll(
string name
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.Replace Method

Replace a specific name/value pair.

public void Replace(
string name,
string oldValue,
string newValue
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.ReplaceAll Method

Replace all form variables with a particular name. This is the same as calling RemoveAll and then Add.

public void ReplaceAll(
string name,
string newValue
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.ToString Method

Serializes all the name/value pairs into a string. The format of the string matches the HTTP protocol specification for transmitting form variables to a server. This can be handy for checking the form variables in your web page. Generally you won't be sending it to a server because HttpClient handles that for you.

public override string ToString();

Return Value

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


FormVariables.ValueOf Method

Returns the value of the name/value pair with the specified name. Throws an exception if there aren't any pairs with that name or if there's more than one. Use AllValuesOf to handle cases where there isn't exactly one name/value pair with the requested name.

public string ValueOf(
string name
);

See Also

FormVariables Class | NUnit.Extensions.Asp Namespace


HtmlTagTester Class

An HTML tag. This class performs some of the magic that allows NUnitAsp to construct testers before pages are loaded and to have testers change as the current page changes.

When using the methods on this class, check the API documentation before caching the results. The API of this class may change in future releases.

For a list of all members of this type, see HtmlTagTester Members.

System.Object
Tester
ControlTester
HtmlTagTester

public class HtmlTagTester : ControlTester

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlTagTester Members | NUnit.Extensions.Asp Namespace


HtmlTagTester Members

HtmlTagTester overview

Public Static Methods

TestInstance Overloaded. For NUnitAsp's test suite only.

Public Instance Constructors

HtmlTagTester Overloaded. Initializes a new instance of the HtmlTagTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags | A temporary hack--this method WILL GO AWAY!
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute | Returns true if this tag has the specified attribute.
HasChildren | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTagTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTagTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlTagTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTagTester(string,string,Tester);

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTagTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester Constructor Overload List


HtmlTagTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTagTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester Constructor Overload List


HtmlTagTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlTagTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester Constructor Overload List


HtmlTagTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTagTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester Constructor Overload List


HtmlTagTester Properties

The properties of the HtmlTagTester class are listed below. For a complete list of HtmlTagTester class members, see the HtmlTagTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags | A temporary hack--this method WILL GO AWAY!
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.BodyNoTags Property

A temporary hack--this method WILL GO AWAY!

public string BodyNoTags {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.HtmlId Property

The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.

public override string HtmlId {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.InnerHtml Property

The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".

public string InnerHtml {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Name Property

Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".

public string Name {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Parent Property

Returns the tag that contains this one. Don't cache it. Don't use this on the root element.

public HtmlTagTester Parent {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.RenderedInnerHtml Property

The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".

public string RenderedInnerHtml {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Tag Property

The HTML tag we're testing.

protected override HtmlTagTester Tag {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Visible Property

Returns true if the tag is visible on the current page.

public override bool Visible {get;}

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester Methods

The methods of the HtmlTagTester class are listed below. For a complete list of HtmlTagTester class members, see the HtmlTagTester Members topic.

Public Static Methods

TestInstance Overloaded. For NUnitAsp's test suite only.

Public Instance Methods

Attribute | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute | Returns true if this tag has the specified attribute.
HasChildren | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Attribute Method

Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.

public string Attribute(
string name
);

Parameters

name
The name of the attribute.

Return Value

The value of the attribute

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.AttributeAsIntWithNegOneDefault Method

Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.

public int AttributeAsIntWithNegOneDefault(
string name
);

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Child Method

Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.

public HtmlTagTester Child(
string tag
);

Parameters

tag
The type of tag to look for. Don't include angle brackets.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.Children Method

Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.

Don't cache the results of this call.

public HtmlTagTester[] Children(
string tag
);

Parameters

tag
The type of tag to return. Don't include angle brackets.

Return Value

The tags, or an empty array if none.

Example

To get all rows in a table:

HtmlTagTester[] rows = table.Children("tr");

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.ChildrenByXPath Method

Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.

Don't cache the results of this call.

public HtmlTagTester[] ChildrenByXPath(
string xpath
);

Parameters

xpath
The XPath expression to match.

Return Value

The tags, or an empty array if none.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.HasAttribute Method

Returns true if this tag has the specified attribute.

public bool HasAttribute(
string name
);

Parameters

name
The name of the attribute.

Return Value

True if the attribute is present (even if it has no value); false otherwise

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.HasChildren Method

Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.

public bool HasChildren(
string tag
);

Parameters

tag
The type of tag to look for. Don't include angle brackets.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.OptionalAttribute Method

Returns the value of an attribute on this tag or null if the attribute isn't present.

public string OptionalAttribute(
string name
);

Parameters

name
The name of the attribute.

Return Value

The value of the attribute or null if not present.

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


TestInstance Method

NUnitAsp

HtmlTagTester.TestInstance Method

For NUnitAsp's test suite only.

Overload List

For NUnitAsp's test suite only.

public static HtmlTagTester TestInstance(string,string);

For NUnitAsp's test suite only.

public static HtmlTagTester TestInstance(string,string,string);

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.TestInstance Method (String, String)

For NUnitAsp's test suite only.

public static HtmlTagTester TestInstance(
string htmlPage,
string xpath
);

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester.TestInstance Overload List


HtmlTagTester.TestInstance Method (String, String, String)

For NUnitAsp's test suite only.

public static HtmlTagTester TestInstance(
string htmlPage,
string id,
string description
);

See Also

HtmlTagTester Class | NUnit.Extensions.Asp Namespace | HtmlTagTester.TestInstance Overload List


HtmlTagTester.ElementNotVisibleException Class

For a list of all members of this type, see HtmlTagTester.ElementNotVisibleException Members.

System.Object
Exception
ApplicationException
HtmlTagTester.ElementNotVisibleException

public class HtmlTagTester.ElementNotVisibleException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlTagTester.ElementNotVisibleException Members | NUnit.Extensions.Asp Namespace


HtmlTagTester.ElementNotVisibleException Members

HtmlTagTester.ElementNotVisibleException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HtmlTagTester.ElementNotVisibleException Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.NoHtmlIdException Class

For a list of all members of this type, see HtmlTagTester.NoHtmlIdException Members.

System.Object
Exception
ApplicationException
HtmlTagTester.NoHtmlIdException

public class HtmlTagTester.NoHtmlIdException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlTagTester.NoHtmlIdException Members | NUnit.Extensions.Asp Namespace


HtmlTagTester.NoHtmlIdException Members

HtmlTagTester.NoHtmlIdException overview

Public Instance Constructors

HtmlTagTester.NoHtmlIdException Constructor

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HtmlTagTester.NoHtmlIdException Class | NUnit.Extensions.Asp Namespace


HtmlTagTester.NoHtmlIdException Constructor

public HtmlTagTester.NoHtmlIdException(
string controlDescription
);

See Also

HtmlTagTester.NoHtmlIdException Class | NUnit.Extensions.Asp Namespace


HttpClient Class

A web client, capable of communicating with a web server.

For a list of all members of this type, see HttpClient Members.

System.Object
HttpClient

public class HttpClient

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient Members | NUnit.Extensions.Asp Namespace


HttpClient Members

HttpClient overview

Public Static Fields

Default | The HttpClient that's used by default in all tests.If you're creating a custom tester, don't use this property! Use ControlTester.Browser instead.
FIREFOX_USER_AGENT | A User Agent string provided by Firefox 1.0. Use this with UserAgent when you want NUnitAsp to see what Firefox sees.
IE_USER_AGENT | A user agent string provided by Internet Explorer 6.0. Use this with UserAgent when you want NUnitAsp to see what IE sees.

Public Instance Constructors

HttpClient Constructor Initializes a new instance of the HttpClient class.

Public Instance Fields

Credentials | Username and password (null if none). Set automatically if the username and password are supplied in the URL (i.e., "http://username:password@host"). Can be used with both "basic" and "Windows Integrated" (NTLM) authentication methods. Set this property to CredentialCache.DefaultCredentials to use your current Windows login.
Proxy | The proxy server information to use to proxy HTTP requests. If this property is set to null, the default value returned by GlobalProxySelection.Select is used.
UrlReferrer | URL containing the hyperlink or form that caused the browser to load the current url (null if none). Fragments aren't included (the part of the URL that comes after a '#').
UserAgent | The user-agent string to send to the server. Useful if you want to pretend to be a specific browser. Defaults to IE_USER_AGENT.Be careful when changing this, as ASP.NET renders controls differently for different user agents. NUnitAsp's testers may not be able to recognize a control that was rendered for a different browser.
UserLanguages | The language-tag elements to send to the server (null if none). These appear in the Request.UserLanguages array in the target page.

Public Instance Properties

Cookies | The cookies sent to the server. These are usually set by the server but your test can add cookies to the container and they'll be sent too.
CurrentPageText | The raw contents of the current page.
CurrentUrl | URL the browser most recently retrieved (null if none). Fragments aren't included (the part of the URL that comes after a '#').
ElapsedServerTime | The total time this object has spent waiting for web servers to respond.

Public Instance Methods

CookieValue | Returns the value of a cookie. Throws exception if the cookie hasn't been set.
Equals (inherited from Object) |
FollowLink | Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.
GetHashCode (inherited from Object) |
GetPage | Retrieves a page from a web server.
GetType (inherited from Object) |
HasCookie | Checks to see if a cookie has been set.
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient Constructor

Initializes a new instance of the HttpClient class.

public HttpClient();

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient Fields

The fields of the HttpClient class are listed below. For a complete list of HttpClient class members, see the HttpClient Members topic.

Public Static Fields

Default | The HttpClient that's used by default in all tests.If you're creating a custom tester, don't use this property! Use ControlTester.Browser instead.
FIREFOX_USER_AGENT | A User Agent string provided by Firefox 1.0. Use this with UserAgent when you want NUnitAsp to see what Firefox sees.
IE_USER_AGENT | A user agent string provided by Internet Explorer 6.0. Use this with UserAgent when you want NUnitAsp to see what IE sees.

Public Instance Fields

Credentials | Username and password (null if none). Set automatically if the username and password are supplied in the URL (i.e., "http://username:password@host"). Can be used with both "basic" and "Windows Integrated" (NTLM) authentication methods. Set this property to CredentialCache.DefaultCredentials to use your current Windows login.
Proxy | The proxy server information to use to proxy HTTP requests. If this property is set to null, the default value returned by GlobalProxySelection.Select is used.
UrlReferrer | URL containing the hyperlink or form that caused the browser to load the current url (null if none). Fragments aren't included (the part of the URL that comes after a '#').
UserAgent | The user-agent string to send to the server. Useful if you want to pretend to be a specific browser. Defaults to IE_USER_AGENT.Be careful when changing this, as ASP.NET renders controls differently for different user agents. NUnitAsp's testers may not be able to recognize a control that was rendered for a different browser.
UserLanguages | The language-tag elements to send to the server (null if none). These appear in the Request.UserLanguages array in the target page.

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.Credentials Field

Username and password (null if none). Set automatically if the username and password are supplied in the URL (i.e., "http://username:password@host"). Can be used with both "basic" and "Windows Integrated" (NTLM) authentication methods. Set this property to CredentialCache.DefaultCredentials to use your current Windows login.

public ICredentials Credentials;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.Default Field

The HttpClient that's used by default in all tests.

If you're creating a custom tester, don't use this property! Use ControlTester.Browser instead.

public static HttpClient Default;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.FIREFOX_USER_AGENT Field

A User Agent string provided by Firefox 1.0. Use this with UserAgent when you want NUnitAsp to see what Firefox sees.

public const string FIREFOX_USER_AGENT;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.IE_USER_AGENT Field

A user agent string provided by Internet Explorer 6.0. Use this with UserAgent when you want NUnitAsp to see what IE sees.

public const string IE_USER_AGENT;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.Proxy Field

The proxy server information to use to proxy HTTP requests. If this property is set to null, the default value returned by GlobalProxySelection.Select is used.

public IWebProxy Proxy;

Example

Browser.Proxy = new WebProxy("http://myproxy:8080");

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.UrlReferrer Field

URL containing the hyperlink or form that caused the browser to load the current url (null if none). Fragments aren't included (the part of the URL that comes after a '#').

public Uri UrlReferrer;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.UserAgent Field

The user-agent string to send to the server. Useful if you want to pretend to be a specific browser. Defaults to IE_USER_AGENT.

Be careful when changing this, as ASP.NET renders controls differently for different user agents. NUnitAsp's testers may not be able to recognize a control that was rendered for a different browser.

public string UserAgent;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.UserLanguages Field

The language-tag elements to send to the server (null if none). These appear in the Request.UserLanguages array in the target page.

public string[] UserLanguages;

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient Properties

The properties of the HttpClient class are listed below. For a complete list of HttpClient class members, see the HttpClient Members topic.

Public Instance Properties

Cookies | The cookies sent to the server. These are usually set by the server but your test can add cookies to the container and they'll be sent too.
CurrentPageText | The raw contents of the current page.
CurrentUrl | URL the browser most recently retrieved (null if none). Fragments aren't included (the part of the URL that comes after a '#').
ElapsedServerTime | The total time this object has spent waiting for web servers to respond.

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.Cookies Property

The cookies sent to the server. These are usually set by the server but your test can add cookies to the container and they'll be sent too.

public System.Net.CookieContainer Cookies {get;}

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.CurrentPageText Property

The raw contents of the current page.

public string CurrentPageText {get;}

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.CurrentUrl Property

URL the browser most recently retrieved (null if none). Fragments aren't included (the part of the URL that comes after a '#').

public System.Uri CurrentUrl {get;}

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.ElapsedServerTime Property

The total time this object has spent waiting for web servers to respond.

public System.TimeSpan ElapsedServerTime {get;}

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient Methods

The methods of the HttpClient class are listed below. For a complete list of HttpClient class members, see the HttpClient Members topic.

Public Instance Methods

CookieValue | Returns the value of a cookie. Throws exception if the cookie hasn't been set.
Equals (inherited from Object) |
FollowLink | Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.
GetHashCode (inherited from Object) |
GetPage | Retrieves a page from a web server.
GetType (inherited from Object) |
HasCookie | Checks to see if a cookie has been set.
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.CookieValue Method

Returns the value of a cookie. Throws exception if the cookie hasn't been set.

public string CookieValue(
string cookieName
);

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.FollowLink Method

Retrieves a page from a web server. Different from GetPage in that it sets the current page as the referrer. You should use normally use GetPage.

public void FollowLink(
string url
);

Parameters

url

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.GetPage Method

Retrieves a page from a web server.

public void GetPage(
string url
);

Parameters

url
The URL of the page to get.

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.HasCookie Method

Checks to see if a cookie has been set.

public bool HasCookie(
string cookieName
);

Parameters

cookieName
The name of the cookie.

Return Value

'true' if the cookie has been set.

See Also

HttpClient Class | NUnit.Extensions.Asp Namespace


HttpClient.AspServerException Class

Exception: The requested URL caused an unhandled exception on the ASP.NET server. Fix the production code so it doesn't throw the exception.

For a list of all members of this type, see HttpClient.AspServerException Members.

System.Object
Exception
ApplicationException
HttpClient.AspServerException

public class HttpClient.AspServerException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient.AspServerException Members | NUnit.Extensions.Asp Namespace


HttpClient.AspServerException Members

HttpClient.AspServerException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient.AspServerException Class | NUnit.Extensions.Asp Namespace


HttpClient.BadStatusException Class

Exception: The server returned an unexpected status code. Determine what's wrong with the server.

For a list of all members of this type, see HttpClient.BadStatusException Members.

System.Object
Exception
ApplicationException
HttpClient.BadStatusException

public class HttpClient.BadStatusException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient.BadStatusException Members | NUnit.Extensions.Asp Namespace


HttpClient.BadStatusException Members

HttpClient.BadStatusException overview

Public Instance Fields

Status The HTTP status code returned by the server

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient.BadStatusException Class | NUnit.Extensions.Asp Namespace


HttpClient.BadStatusException Fields

The fields of the HttpClient.BadStatusException class are listed below. For a complete list of HttpClient.BadStatusException class members, see the HttpClient.BadStatusException Members topic.

Public Instance Fields

Status The HTTP status code returned by the server

See Also

HttpClient.BadStatusException Class | NUnit.Extensions.Asp Namespace


HttpClient.BadStatusException.Status Field

The HTTP status code returned by the server

public readonly HttpStatusCode Status;

See Also

HttpClient.BadStatusException Class | NUnit.Extensions.Asp Namespace


HttpClient.NoPageException Class

Exception: A request has been made that requires a page to have been loaded, but no page has been loaded yet. Call GetPage() before calling the method that threw this exception.

For a list of all members of this type, see HttpClient.NoPageException Members.

System.Object
Exception
ApplicationException
HttpClient.NoPageException

public class HttpClient.NoPageException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient.NoPageException Members | NUnit.Extensions.Asp Namespace


HttpClient.NoPageException Members

HttpClient.NoPageException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient.NoPageException Class | NUnit.Extensions.Asp Namespace


HttpClient.NotFoundException Class

Exception: The requested URL was not found. Correct the URL or determine what's wrong with the server.

For a list of all members of this type, see HttpClient.NotFoundException Members.

System.Object
Exception
ApplicationException
HttpClient.NotFoundException

public class HttpClient.NotFoundException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient.NotFoundException Members | NUnit.Extensions.Asp Namespace


HttpClient.NotFoundException Members

HttpClient.NotFoundException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient.NotFoundException Class | NUnit.Extensions.Asp Namespace


HttpClient.RedirectLoopException Class

Exception: Too many HTTP redirects were detected. Check for infinite redirection loop.

For a list of all members of this type, see HttpClient.RedirectLoopException Members.

System.Object
Exception
ApplicationException
HttpClient.RedirectLoopException

public class HttpClient.RedirectLoopException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HttpClient.RedirectLoopException Members | NUnit.Extensions.Asp Namespace


HttpClient.RedirectLoopException Members

HttpClient.RedirectLoopException overview

Public Instance Fields

TargetUrl The target URL of the failed redirect

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HttpClient.RedirectLoopException Class | NUnit.Extensions.Asp Namespace


HttpClient.RedirectLoopException Fields

The fields of the HttpClient.RedirectLoopException class are listed below. For a complete list of HttpClient.RedirectLoopException class members, see the HttpClient.RedirectLoopException Members topic.

Public Instance Fields

TargetUrl The target URL of the failed redirect

See Also

HttpClient.RedirectLoopException Class | NUnit.Extensions.Asp Namespace


HttpClient.RedirectLoopException.TargetUrl Field

The target URL of the failed redirect

public readonly string TargetUrl;

See Also

HttpClient.RedirectLoopException Class | NUnit.Extensions.Asp Namespace


ParseException Class

Exception: The tester has a bug: it was looking for some HTML and didn't find it. Report this exception to the author of the tester.

For a list of all members of this type, see ParseException Members.

System.Object
Exception
ApplicationException
ParseException

public class ParseException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ParseException Members | NUnit.Extensions.Asp Namespace


ParseException Members

ParseException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ParseException Class | NUnit.Extensions.Asp Namespace


Tester Class

Base class for all NUnitAsp testers. To create your own tester classes, you should usually extend AspControlTester or HtmlControlTester instead.

Not intended for third-party use. The API for this class will change in future releases. Currently, this class assumes that every tester corresponds to exactly one tag in the web page. That may change in the future.

For a list of all members of this type, see Tester Members.

System.Object
Tester

public abstract class Tester

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Tester Members | NUnit.Extensions.Asp Namespace


Tester Members

Tester overview

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the tag being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Constructors

Tester Constructor Initializes a new instance of the Tester class.

Protected Instance Properties

Tag The HTML tag we're testing.

Protected Instance Methods

AssertVisible | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
MemberwiseClone (inherited from Object) |

Protected Internal Instance Properties

Browser | The browser instance used to load the page containing the thing being tested.
Form | The tester for the form containing the thing being tested.

Protected Internal Instance Methods

GetChildElementHtmlId Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester Constructor

Initializes a new instance of the Tester class.

protected Tester();

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester Properties

The properties of the Tester class are listed below. For a complete list of Tester class members, see the Tester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the tag being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible | Returns true if the control is visible on the current page.

Protected Instance Properties

Tag The HTML tag we're testing.

Protected Internal Instance Properties

Browser | The browser instance used to load the page containing the thing being tested.
Form | The tester for the form containing the thing being tested.

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.AspId Property

The ASP.NET ID of the thing being tested. It corresponds to the ID in the ASP.NET source code.

public abstract string AspId {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.Browser Property

The browser instance used to load the page containing the thing being tested.

protected internal abstract HttpClient Browser {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.Description Property

A human-readable description of the location of the control.

public abstract string Description {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.Form Property

The tester for the form containing the thing being tested.

protected internal abstract WebFormTester Form {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.HtmlId Property

The HTML ID of the tag being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.

public abstract string HtmlId {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.HtmlIdAndDescription Property

A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.

public abstract string HtmlIdAndDescription {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.Tag Property

The HTML tag we're testing.

protected virtual HtmlTagTester Tag {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.Visible Property

Returns true if the control is visible on the current page.

public virtual bool Visible {get;}

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester Methods

The methods of the Tester class are listed below. For a complete list of Tester class members, see the Tester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
MemberwiseClone (inherited from Object) |

Protected Internal Instance Methods

GetChildElementHtmlId Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.AssertVisible Method

Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.

protected void AssertVisible();

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.GetChildElementHtmlId Method

Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

protected internal abstract string GetChildElementHtmlId(
string aspId
);

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.ToString Method

Provides a friendly message reminding users not to put testers in assertions.

public override string ToString();

See Also

Tester Class | NUnit.Extensions.Asp Namespace


Tester.AttributeMissingException Class

For a list of all members of this type, see Tester.AttributeMissingException Members.

System.Object
Exception
ApplicationException
Tester.AttributeMissingException

public class Tester.AttributeMissingException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Tester.AttributeMissingException Members | NUnit.Extensions.Asp Namespace


Tester.AttributeMissingException Members

Tester.AttributeMissingException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

Tester.AttributeMissingException Class | NUnit.Extensions.Asp Namespace


WebAssert Class

Assertions specific to NUnitAsp's web testers.

For a list of all members of this type, see WebAssert Members.

System.Object
WebAssert

public class WebAssert

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

WebAssert Members | NUnit.Extensions.Asp Namespace


WebAssert Members

WebAssert overview

Public Static Methods

AreEqual | Overloaded. Asserts that two "rows" of strings are identical.
AreEqualIgnoringOrder | Overloaded. Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.
CurrentUrlEndsWith | Overloaded. Asserts that the default browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.
NotVisible | Overloaded. Asserts that a specific control is not on the current web page, or if it is, its "Visible" parameter is set to "false." This method does not distinguish between non-existant controls and non-visible controls: use with caution.
Sorted | Overloaded. Asserts that the "rows" in a "table" of strings are sorted.
TableContainsRow | Asserts that a "table" of strings contains a particular "row."
Visible | Overloaded. Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

Public Instance Constructors

WebAssert Constructor Initializes a new instance of the WebAssert class.

Public Instance Methods

Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert Constructor

Initializes a new instance of the WebAssert class.

public WebAssert();

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert Methods

The methods of the WebAssert class are listed below. For a complete list of WebAssert class members, see the WebAssert Members topic.

Public Static Methods

AreEqual | Overloaded. Asserts that two "rows" of strings are identical.
AreEqualIgnoringOrder | Overloaded. Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.
CurrentUrlEndsWith | Overloaded. Asserts that the default browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.
NotVisible | Overloaded. Asserts that a specific control is not on the current web page, or if it is, its "Visible" parameter is set to "false." This method does not distinguish between non-existant controls and non-visible controls: use with caution.
Sorted | Overloaded. Asserts that the "rows" in a "table" of strings are sorted.
TableContainsRow | Asserts that a "table" of strings contains a particular "row."
Visible | Overloaded. Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

Public Instance Methods

Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


AreEqual Method

NUnitAsp

WebAssert.AreEqual Method

Asserts that two "rows" of strings are identical.

Overload List

Asserts that two "rows" of strings are identical.

public static void AreEqual(string[],string[]);

Asserts that two "rows" of strings are identical.

public static void AreEqual(string[],string[],string);

Asserts that two "tables" of strings are identical.

public static void AreEqual(string[][],string[][]);

Asserts that two "tables" of strings are identical.

public static void AreEqual(string[][],string[][],string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.AreEqual Method (String[], String[])

Asserts that two "rows" of strings are identical.

public static void AreEqual(
string[] expected,
string[] actual
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqual Overload List


WebAssert.AreEqual Method (String[], String[], String)

Asserts that two "rows" of strings are identical.

public static void AreEqual(
string[] expected,
string[] actual,
string message
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqual Overload List


WebAssert.AreEqual Method (String[][], String[][])

Asserts that two "tables" of strings are identical.

public static void AreEqual(
string[][] expected,
string[][] actual
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqual Overload List


WebAssert.AreEqual Method (String[][], String[][], String)

Asserts that two "tables" of strings are identical.

public static void AreEqual(
string[][] expected,
string[][] actual,
string message
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqual Overload List


AreEqualIgnoringOrder Method

NUnitAsp

WebAssert.AreEqualIgnoringOrder Method

Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.

Overload List

Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.

public static void AreEqualIgnoringOrder(string[][],string[][]);

Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.

public static void AreEqualIgnoringOrder(string[][],string[][],string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.AreEqualIgnoringOrder Method (String[][], String[][])

Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.

public static void AreEqualIgnoringOrder(
string[][] expected,
string[][] actual
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqualIgnoringOrder Overload List


WebAssert.AreEqualIgnoringOrder Method (String[][], String[][], String)

Asserts that two "tables" of strings are identical, but permits ordering differences. Individual rows in the tables must match, but the order of the rows may differ.

public static void AreEqualIgnoringOrder(
string[][] expected,
string[][] actual,
string message
);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.AreEqualIgnoringOrder Overload List


CurrentUrlEndsWith Method

NUnitAsp

WebAssert.CurrentUrlEndsWith Method

Asserts that the specified browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.

Overload List

Asserts that the specified browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.

public static void CurrentUrlEndsWith(HttpClient,string);

Asserts that the default browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.

public static void CurrentUrlEndsWith(string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.CurrentUrlEndsWith Method (HttpClient, String)

Asserts that the specified browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.

public static void CurrentUrlEndsWith(
HttpClient browser,
string expectedEndOfUrl
);

Parameters

browser
The browser to check.
expectedEndOfUrl
What you expect the URL to end with.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.CurrentUrlEndsWith Overload List


WebAssert.CurrentUrlEndsWith Method (String)

Asserts that the default browser's current URL ends with a specific string. Start your expectedEndOfUrl with a '/' for maximum accuracy.

public static void CurrentUrlEndsWith(
string expectedEndOfUrl
);

Parameters

expectedEndOfUrl
What you expect the URL to end with.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.CurrentUrlEndsWith Overload List


NotVisible Method

NUnitAsp

WebAssert.NotVisible Method

Asserts that a specific control is not on the current web page, or if it is, its "Visible" parameter is set to "false." This method does not distinguish between non-existant controls and non-visible controls: use with caution.

Overload List

Asserts that a specific control is not on the current web page, or if it is, its "Visible" parameter is set to "false." This method does not distinguish between non-existant controls and non-visible controls: use with caution.

public static void NotVisible(Tester);

Asserts that a specific control is not on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void NotVisible(Tester,string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.NotVisible Method (Tester)

Asserts that a specific control is not on the current web page, or if it is, its "Visible" parameter is set to "false." This method does not distinguish between non-existant controls and non-visible controls: use with caution.

public static void NotVisible(
Tester tester
);

Parameters

tester
The tester for the control to check.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.NotVisible Overload List


WebAssert.NotVisible Method (Tester, String)

Asserts that a specific control is not on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void NotVisible(
Tester tester,
string message
);

Parameters

tester
The tester for the control to check.
message
The error message to display if the assertion fails.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.NotVisible Overload List


Sorted Method

NUnitAsp

WebAssert.Sorted Method

Asserts that the "rows" in a "table" of strings are sorted.

Overload List

Asserts that the "rows" in a "table" of strings are sorted.

public static void Sorted(string[][],int,bool,DataType);

Asserts that the "rows" in a "table" of strings are sorted.

public static void Sorted(string[][],int,bool,DataType,string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.Sorted Method (String[][], Int32, Boolean, DataType)

Asserts that the "rows" in a "table" of strings are sorted.

public static void Sorted(
string[][] data,
int column,
bool isAscending,
DataType type
);

Parameters

data
The table to check.
column
The column that must be sorted.
isAscending
'true' if the table should be sorted from low to high; 'false' if the table should be sorted from high to low.
type
The type of data in the column that's sorted.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.Sorted Overload List


WebAssert.Sorted Method (String[][], Int32, Boolean, DataType, String)

Asserts that the "rows" in a "table" of strings are sorted.

public static void Sorted(
string[][] data,
int column,
bool isAscending,
DataType type,
string message
);

Parameters

data
The table to check.
column
The column that must be sorted.
isAscending
'true' if the table should be sorted from low to high; 'false' if the table should be sorted from high to low.
type
The type of data in the column that's sorted.
message
A noun to display if the assertion fails.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.Sorted Overload List


WebAssert.TableContainsRow Method

Asserts that a "table" of strings contains a particular "row."

public static void TableContainsRow(
string[][] table,
params string[] expectedRow
);

Parameters

table
The table to check.
expectedRow
The row that the table should contain.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


Visible Method

NUnitAsp

WebAssert.Visible Method

Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

Overload List

Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void Visible(Tester);

Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void Visible(Tester,string);

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace


WebAssert.Visible Method (Tester)

Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void Visible(
Tester tester
);

Parameters

tester
The tester for the control to check.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.Visible Overload List


WebAssert.Visible Method (Tester, String)

Asserts that a specific control is on the current web page, with the "Visible" parameter set to "true." This method does not assert that the control is actually visible to the user.

public static void Visible(
Tester tester,
string message
);

Parameters

tester
The tester for the control to check.
message
The error message to display if the assertion fails.

See Also

WebAssert Class | NUnit.Extensions.Asp Namespace | WebAssert.Visible Overload List


WebAssertionException Class

An assumption was violated, either in your tests or in NUnitAsp itself. When you get this exception, look at the exception message for more information.

For a list of all members of this type, see WebAssertionException Members.

System.Object
Exception
ApplicationException
WebAssertionException

public class WebAssertionException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

WebAssertionException Members | NUnit.Extensions.Asp Namespace


WebAssertionException Members

WebAssertionException overview

Public Instance Constructors

WebAssertionException Constructor

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

WebAssertionException Class | NUnit.Extensions.Asp Namespace


WebAssertionException Constructor

public WebAssertionException(
string message
);

See Also

WebAssertionException Class | NUnit.Extensions.Asp Namespace


WebForm Class

Obsolete; use WebFormTester instead.

For a list of all members of this type, see WebForm Members.

System.Object
Tester
WebFormTester
WebForm

public class WebForm : WebFormTester

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

WebForm Members | NUnit.Extensions.Asp Namespace


WebForm Members

WebForm overview

Public Instance Constructors

WebForm Constructor Obsolete; use WebFormTester instead.

Public Instance Properties

AspId (inherited from WebFormTester) | The ASP.NET ID of the form being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from WebFormTester) | A human-readable description of the location of the control.
HtmlId (inherited from WebFormTester) | The HTML ID of the form being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from WebFormTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Variables (inherited from WebFormTester) | The HTML form variables in this form.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
IsPostBack (inherited from WebFormTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
OptionalPostBack (inherited from WebFormTester) | Like PostBack, except that it does nothing if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from WebFormTester) | Overloaded. Emulates ASP.NET's post-back script. To simply submit the form, use Submit instead. If you have access to the JavaScript call string, use OptionalPostBack or the other form of PostBack.
Submit (inherited from WebFormTester) | Submit this form to the server.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

Tag (inherited from WebFormTester) The HTML tag this tester corresponds to.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
MemberwiseClone (inherited from Object) |

Protected Internal Instance Properties

Action (inherited from WebFormTester) | The "action" attribute of this form; will be an empty string if there isn't one.
Browser (inherited from WebFormTester) | The browser instance used to load the page containing the thing being tested.
Form (inherited from WebFormTester) | The tester for the form containing the thing being tested.
Method (inherited from WebFormTester) | The "method" attribute of this form.

Protected Internal Instance Methods

GetChildElementHtmlId (inherited from WebFormTester) Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

See Also

WebForm Class | NUnit.Extensions.Asp Namespace


WebForm Constructor

Obsolete; use WebFormTester instead.

public WebForm(
HttpClient browser
);

See Also

WebForm Class | NUnit.Extensions.Asp Namespace


WebFormTester Class

A tester for an ASP.NET form. Most of the methods in this class aren't meant to be called by third parties.

The API for this class will change in future releases.

For a list of all members of this type, see WebFormTester Members.

System.Object
Tester
WebFormTester

public class WebFormTester : Tester

Requirements

Namespace: NUnit.Extensions.Asp

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

WebFormTester Members | NUnit.Extensions.Asp Namespace


WebFormTester Members

WebFormTester overview

Public Instance Constructors

WebFormTester Overloaded. Initializes a new instance of the WebFormTester class.

Public Instance Properties

AspId | The ASP.NET ID of the form being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the form being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Variables | The HTML form variables in this form.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
IsPostBack | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
OptionalPostBack | Like PostBack, except that it does nothing if candidatePostBackScript doesn't contain a post-back script.
PostBack | Overloaded. Emulates ASP.NET's post-back script. To simply submit the form, use Submit instead. If you have access to the JavaScript call string, use OptionalPostBack or the other form of PostBack.
Submit | Submit this form to the server.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

Tag The HTML tag this tester corresponds to.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
MemberwiseClone (inherited from Object) |

Protected Internal Instance Properties

Action | The "action" attribute of this form; will be an empty string if there isn't one.
Browser | The browser instance used to load the page containing the thing being tested.
Form | The tester for the form containing the thing being tested.
Method | The "method" attribute of this form.

Protected Internal Instance Methods

GetChildElementHtmlId Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester Constructor

Create the tester and link it to an ASP.NET web form.

Overload List

Create the tester and link it to an ASP.NET web form.

public WebFormTester(HttpClient);

public WebFormTester(string,HttpClient);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester Constructor (HttpClient)

Create the tester and link it to an ASP.NET web form.

public WebFormTester(
HttpClient browser
);

Parameters

browser
The browser used to load this page.

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace | WebFormTester Constructor Overload List


WebFormTester Constructor (String, HttpClient)

public WebFormTester(
string aspId,
HttpClient browser
);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace | WebFormTester Constructor Overload List


WebFormTester Properties

The properties of the WebFormTester class are listed below. For a complete list of WebFormTester class members, see the WebFormTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the form being tested. It corresponds to the ID in the ASP.NET source code.
Description | A human-readable description of the location of the control.
HtmlId | The HTML ID of the form being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Variables | The HTML form variables in this form.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

Tag The HTML tag this tester corresponds to.

Protected Internal Instance Properties

Action | The "action" attribute of this form; will be an empty string if there isn't one.
Browser | The browser instance used to load the page containing the thing being tested.
Form | The tester for the form containing the thing being tested.
Method | The "method" attribute of this form.

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Action Property

The "action" attribute of this form; will be an empty string if there isn't one.

protected internal string Action {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.AspId Property

The ASP.NET ID of the form being tested. It corresponds to the ID in the ASP.NET source code.

public override string AspId {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Browser Property

The browser instance used to load the page containing the thing being tested.

protected internal override HttpClient Browser {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Form Property

The tester for the form containing the thing being tested.

protected internal override WebFormTester Form {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.HtmlId Property

The HTML ID of the form being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.

public override string HtmlId {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.HtmlIdAndDescription Property

A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.

public override string HtmlIdAndDescription {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Method Property

The "method" attribute of this form.

protected internal string Method {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Tag Property

The HTML tag this tester corresponds to.

protected override HtmlTagTester Tag {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.Variables Property

The HTML form variables in this form.

public FormVariables Variables {get;}

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester Methods

The methods of the WebFormTester class are listed below. For a complete list of WebFormTester class members, see the WebFormTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
IsPostBack | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
OptionalPostBack | Like PostBack, except that it does nothing if candidatePostBackScript doesn't contain a post-back script.
PostBack | Overloaded. Emulates ASP.NET's post-back script. To simply submit the form, use Submit instead. If you have access to the JavaScript call string, use OptionalPostBack or the other form of PostBack.
Submit | Submit this form to the server.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
MemberwiseClone (inherited from Object) |

Protected Internal Instance Methods

GetChildElementHtmlId Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.GetChildElementHtmlId Method

Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

protected internal override string GetChildElementHtmlId(
string aspId
);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.IsPostBack Method

Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.

public bool IsPostBack(
string candidatePostBackScript
);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.OptionalPostBack Method

Like PostBack, except that it does nothing if candidatePostBackScript doesn't contain a post-back script.

public void OptionalPostBack(
string candidatePostBackScript
);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


PostBack Method

NUnitAsp

WebFormTester.PostBack Method

Emulates ASP.NET's post-back script (often seen as a Javascript "__doPostBack" call). To simply submit the form, use Submit instead. If you don't have access to the JavaScript call, use PostBack instead. This method throws an exception if the postBackScript string isn't actually a post-back script (for example, if it's an empty string). Use OptionalPostBack if the string isn't expected to contain a post-back script all of the time.

Overload List

Emulates ASP.NET's post-back script (often seen as a Javascript "__doPostBack" call). To simply submit the form, use Submit instead. If you don't have access to the JavaScript call, use PostBack instead. This method throws an exception if the postBackScript string isn't actually a post-back script (for example, if it's an empty string). Use OptionalPostBack if the string isn't expected to contain a post-back script all of the time.

public void PostBack(string);

Emulates ASP.NET's post-back script. To simply submit the form, use Submit instead. If you have access to the JavaScript call string, use OptionalPostBack or the other form of PostBack.

public void PostBack(string,string);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


WebFormTester.PostBack Method (String)

Emulates ASP.NET's post-back script (often seen as a Javascript "__doPostBack" call). To simply submit the form, use Submit instead. If you don't have access to the JavaScript call, use PostBack instead. This method throws an exception if the postBackScript string isn't actually a post-back script (for example, if it's an empty string). Use OptionalPostBack if the string isn't expected to contain a post-back script all of the time.

public void PostBack(
string postBackScript
);

Example

ASP.NET LinkButtons are rendered as <a> hyperlinks with a post-back script call in the "href" attribute. The following code takes the call from the attribute and calls PostBack(), causing NUnitAsp to analyze the post-back script call, set the appropriate environment variables, and submit the form.

            string href = Tag.Attribute("href");
            Form.PostBack(href);

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace | WebFormTester.PostBack Overload List


WebFormTester.PostBack Method (String, String)

Emulates ASP.NET's post-back script. To simply submit the form, use Submit instead. If you have access to the JavaScript call string, use OptionalPostBack or the other form of PostBack.

public void PostBack(
string eventTarget,
string eventArgument
);

Parameters

eventTarget
The "event target" parameter for the post-back script.
eventArgument
The "event argument" parameter for the post-back script.

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace | WebFormTester.PostBack Overload List


WebFormTester.Submit Method

Submit this form to the server.

public void Submit();

See Also

WebFormTester Class | NUnit.Extensions.Asp Namespace


NUnit.Extensions.Asp.AspTester

NUnitAsp

NUnit.Extensions.Asp.AspTester Namespace

Classes

Class | Description
AspControlTester | Base class for testing all ASP.NET server controls. Extend this class if you're creating a tester for a custom control.
ButtonTester | Tester for System.Web.UI.WebControls.Button
CheckBoxTester | Tester for System.Web.UI.WebControls.CheckBox
CompareValidatorTester | Tester for System.Web.UI.WebControls.CompareValidator
ContainerMustBeRowException | Exception: The container of the control being tested was a DataGridTester, but it should be a Row. Change "new MyTester("foo", datagrid)" to "new MyTester("foo", datagrid.getRow(rowNum))".
CustomValidatorTester | Tester for System.Web.UI.WebControls.CustomValidator
DataGridTester | Tester for System.Web.UI.WebControls.DataGrid
DataGridTester.Row | Tests a row within a data grid.
DropDownListTester | Tester for System.Web.UI.WebControls.DropDownList
ImageButtonTester | Tester for System.Web.UI.WebControls.ImageButton
LabeledControlTester | Abstract base class for testing controls that have associated labels, like CheckBoxTester. You can probably ignore this class.
LabelTester | Tester for System.Web.UI.WebControls.Label
LinkButtonTester | Tester for System.Web.UI.WebControls.LinkButton
ListBoxTester | Tester for System.Web.UI.WebControls.ListBox
ListControlTester | Base class for list testers.
ListControlTester.IllegalInputException | The index of the list was set to a value that doesn't correspond to a list item. Fix the test so that it sets the value correctly, or fix the production code so that it generates the correct number of list items.
ListControlTester.NoSelectionException | The test asked a list what item was selected when no items were selected. Fix the test so that it doesn't ask the question, or fix the production code so that a list item is selected.
NamingContainerTester | Base class for testing all ASP.NET server controls that have the "naming container" property set to "true." Use this class when you're creating a custom tester for a server control that is a naming container.
PanelTester | Tester for System.Web.UI.WebControls.Panel
RadioButtonTester | Tester for System.Web.UI.WebControls.RadioButton
RangeValidatorTester | Tester for System.Web.UI.WebControls.RangeValidator
RegularExpressionValidatorTester | Tester for System.Web.UI.WebControls.RegularExpressionValidator
RepeaterTester Tester for System.Web.UI.WebControls.Repeater. Generally, you don't test through this tester. Instead, you use the Item method to use as a container for testing controls that are inside the repeater. The ItemCount method may also be useful. This example demonstrates how to test a button that's in the third item of a repeater:
            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Item(2));
RepeaterTester.ContainerMustBeItemException | Exception: The container of the control being tested was a RepeaterTester, but it should be a RepeaterItemTester. Change "new MyTester("foo", repeater)" to "new MyTester("foo", repeater.Item(itemNum))". You may also use repeater.Header, repeater.Footer, or repeater.GetSeparator(separatorNum) as the container argument.
RepeaterTester.RepeaterFooterTester Tester for FooterTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the FooterTemplate of a repeater:
            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Footer);
RepeaterTester.RepeaterHeaderTester Tester for HeaderTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in a repeater's HeaderTemplate:
            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Header);
RepeaterTester.RepeaterItemTester Tester for ItemTemplate and AlternatingItemTemplate, also known as System.Web.UI.WebControls.RepeaterItem. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the third item of a repeater:
            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Item(2));
RepeaterTester.RepeaterSeparatorTester Tester for SeparatorTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the second separator of a repeater:
            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Separator(1));
RepeaterTester.RepeaterTemplateTester | Base class for all repeater template testers. This is an implementation detail and can be ignored.
RequiredFieldValidatorTester | Tester for System.Web.UI.WebControls.RequiredFieldValidator
TextBoxTester | Tester for System.Web.UI.WebControls.TextBox
UserControlTester | Tester for System.Web.UI.UserControl
ValidationSummaryTester | Tester for System.Web.UI.WebControls.ValidationSummary
ValidatorTester | Base class for all validator testers.


AspControlTester Class

Base class for testing all ASP.NET server controls. Extend this class if you're creating a tester for a custom control.

For a list of all members of this type, see AspControlTester Members.

System.Object
Tester
ControlTester
AspControlTester

public abstract class AspControlTester : ControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

AspControlTester Members | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester Members

AspControlTester overview

Public Instance Constructors

AspControlTester Overloaded. Initializes a new instance of the AspControlTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public AspControlTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public AspControlTester(string,Tester);

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public AspControlTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | AspControlTester Constructor Overload List


AspControlTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public AspControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | AspControlTester Constructor Overload List


AspControlTester Properties

The properties of the AspControlTester class are listed below. For a complete list of AspControlTester class members, see the AspControlTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester.Enabled Property

True if the control is enabled.

public bool Enabled {get;}

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester Methods

The methods of the AspControlTester class are listed below. For a complete list of AspControlTester class members, see the AspControlTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


AspControlTester.GenerateAnonymousId Method

Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.

protected string GenerateAnonymousId(
int controlNumber
);

Parameters

controlNumber
The number ASP.NET created for the control.

Return Value

A string that includes the control number and reflects the scheme ASP.NET uses for anonymous control.

See Also

AspControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester Class

Tester for System.Web.UI.WebControls.Button

For a list of all members of this type, see ButtonTester Members.

System.Object
Tester
ControlTester
AspControlTester
ButtonTester

public class ButtonTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ButtonTester Members | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester Members

ButtonTester overview

Public Instance Constructors

ButtonTester Overloaded. Initializes a new instance of the ButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | Get the text on the button
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Click | Click the button.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ButtonTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ButtonTester(string,Tester);

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ButtonTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ButtonTester Constructor Overload List


ButtonTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ButtonTester Constructor Overload List


ButtonTester Properties

The properties of the ButtonTester class are listed below. For a complete list of ButtonTester class members, see the ButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | Get the text on the button
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester.Text Property

Get the text on the button

public string Text {get;}

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester Methods

The methods of the ButtonTester class are listed below. For a complete list of ButtonTester class members, see the ButtonTester Members topic.

Public Instance Methods

Click | Click the button.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ButtonTester.Click Method

Click the button.

public void Click();

See Also

ButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester Class

Tester for System.Web.UI.WebControls.CheckBox

For a list of all members of this type, see CheckBoxTester Members.

System.Object
Tester
ControlTester
AspControlTester
LabeledControlTester
CheckBoxTester

public class CheckBoxTester : LabeledControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

CheckBoxTester Members | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester Members

CheckBoxTester overview

Public Instance Constructors

CheckBoxTester Overloaded. Initializes a new instance of the CheckBoxTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Checked | True if the checkbox is checked, false if not.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text (inherited from LabeledControlTester) | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CheckBoxTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CheckBoxTester(string,Tester);

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CheckBoxTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | CheckBoxTester Constructor Overload List


CheckBoxTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CheckBoxTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | CheckBoxTester Constructor Overload List


CheckBoxTester Properties

The properties of the CheckBoxTester class are listed below. For a complete list of CheckBoxTester class members, see the CheckBoxTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Checked | True if the checkbox is checked, false if not.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text (inherited from LabeledControlTester) | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester.Checked Property

True if the checkbox is checked, false if not.

public virtual bool Checked {get; set;}

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


CheckBoxTester.IsDisabled Property

True if the control is disabled.

protected override bool IsDisabled {get;}

See Also

CheckBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


CompareValidatorTester Class

Tester for System.Web.UI.WebControls.CompareValidator

For a list of all members of this type, see CompareValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester
CompareValidatorTester

public class CompareValidatorTester : ValidatorTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

CompareValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


CompareValidatorTester Members

CompareValidatorTester overview

Public Instance Constructors

CompareValidatorTester Overloaded. Initializes a new instance of the CompareValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage (inherited from ValidatorTester) | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage (inherited from ValidatorTester) | Returns the error message, rendered to a string as a web browser would do.
SpanTag (inherited from ValidatorTester) |
Visible (inherited from ValidatorTester) | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

CompareValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


CompareValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CompareValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CompareValidatorTester(string,Tester);

See Also

CompareValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


CompareValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CompareValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

CompareValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | CompareValidatorTester Constructor Overload List


CompareValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CompareValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

CompareValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | CompareValidatorTester Constructor Overload List


ContainerMustBeRowException Class

Exception: The container of the control being tested was a DataGridTester, but it should be a Row. Change "new MyTester("foo", datagrid)" to "new MyTester("foo", datagrid.getRow(rowNum))".

For a list of all members of this type, see ContainerMustBeRowException Members.

System.Object
Exception
ApplicationException
ContainerMustBeRowException

public class ContainerMustBeRowException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ContainerMustBeRowException Members | NUnit.Extensions.Asp.AspTester Namespace


ContainerMustBeRowException Members

ContainerMustBeRowException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ContainerMustBeRowException Class | NUnit.Extensions.Asp.AspTester Namespace


CustomValidatorTester Class

Tester for System.Web.UI.WebControls.CustomValidator

For a list of all members of this type, see CustomValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester
CustomValidatorTester

public class CustomValidatorTester : ValidatorTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

CustomValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


CustomValidatorTester Members

CustomValidatorTester overview

Public Instance Constructors

CustomValidatorTester Overloaded. Initializes a new instance of the CustomValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage (inherited from ValidatorTester) | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage (inherited from ValidatorTester) | Returns the error message, rendered to a string as a web browser would do.
SpanTag (inherited from ValidatorTester) |
Visible (inherited from ValidatorTester) | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

CustomValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


CustomValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CustomValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CustomValidatorTester(string,Tester);

See Also

CustomValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


CustomValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public CustomValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

CustomValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | CustomValidatorTester Constructor Overload List


CustomValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public CustomValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

CustomValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | CustomValidatorTester Constructor Overload List


DataGridTester Class

Tester for System.Web.UI.WebControls.DataGrid

For a list of all members of this type, see DataGridTester Members.

System.Object
Tester
ControlTester
AspControlTester
DataGridTester

public class DataGridTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

DataGridTester Members | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester Members

DataGridTester overview

Public Instance Constructors

DataGridTester Overloaded. Initializes a new instance of the DataGridTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Cells | An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedCells | An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate the way a browser would render the HTML.
RowCount | The number of rows in the data grid, not counting the header.
TrimmedCells | Obsolete--do not call. An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. Whitespace has been trimmed from the front and back of the cells.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetHeaderRow | The data grid's header row. The first row is always assumed to be the header row.
GetRow | Returns a row from the data grid. Row number zero is the first row after the header row.
GetRowByCellValue | Returns a row containing a specific cell. Looks for the cell as it is returned by RenderedCells.
GetType (inherited from Object) |
Sort | Click a column heading link that was generated with the "allowSorting='true'" attribute.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId |
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public DataGridTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public DataGridTester(string,Tester);

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public DataGridTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace | DataGridTester Constructor Overload List


DataGridTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public DataGridTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace | DataGridTester Constructor Overload List


DataGridTester Properties

The properties of the DataGridTester class are listed below. For a complete list of DataGridTester class members, see the DataGridTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Cells | An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedCells | An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate the way a browser would render the HTML.
RowCount | The number of rows in the data grid, not counting the header.
TrimmedCells | Obsolete--do not call. An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. Whitespace has been trimmed from the front and back of the cells.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Cells Property

An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML.

public string[][] Cells {get;}

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.RenderedCells Property

An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate the way a browser would render the HTML.

public string[][] RenderedCells {get;}

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.RowCount Property

The number of rows in the data grid, not counting the header.

public int RowCount {get;}

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.TrimmedCells Property

Obsolete--do not call. An array of string arrays containing the contents of the data grid, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. Whitespace has been trimmed from the front and back of the cells.

public string[][] TrimmedCells {get;}

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester Methods

The methods of the DataGridTester class are listed below. For a complete list of DataGridTester class members, see the DataGridTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetHeaderRow | The data grid's header row. The first row is always assumed to be the header row.
GetRow | Returns a row from the data grid. Row number zero is the first row after the header row.
GetRowByCellValue | Returns a row containing a specific cell. Looks for the cell as it is returned by RenderedCells.
GetType (inherited from Object) |
Sort | Click a column heading link that was generated with the "allowSorting='true'" attribute.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId |
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.GetChildElementHtmlId Method

protected internal override string GetChildElementHtmlId(
string aspId
);

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.GetHeaderRow Method

The data grid's header row. The first row is always assumed to be the header row.

public Row GetHeaderRow();

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.GetRow Method

Returns a row from the data grid. Row number zero is the first row after the header row.

public Row GetRow(
int rowNumber
);

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.GetRowByCellValue Method

Returns a row containing a specific cell. Looks for the cell as it is returned by RenderedCells.

public Row GetRowByCellValue(
int columnNumber,
string renderedValue
);

Parameters

columnNumber
The column containing the cell to look for (zero-based).
renderedValue
The cell to look for.

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Sort Method

Click a column heading link that was generated with the "allowSorting='true'" attribute.

public void Sort(
int columnNumberZeroBased
);

Parameters

columnNumberZeroBased
The column to sort (zero-based)

See Also

DataGridTester Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row Class

Tests a row within a data grid.

For a list of all members of this type, see DataGridTester.Row Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
DataGridTester.Row

public class DataGridTester.Row : NamingContainerTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

DataGridTester.Row Members | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row Members

DataGridTester.Row overview

Public Instance Constructors

DataGridTester.Row Constructor Create the tester and link it to a row in a specific data grid.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
TrimmedCells | The cells in the row. Whitespace has been trimmed from the front and back of the cells.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag |

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

DataGridTester.Row Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row Constructor

Create the tester and link it to a row in a specific data grid.

public DataGridTester.Row(
int rowNumberWhereZeroIsHeader,
DataGridTester container
);

Parameters

rowNumberWhereZeroIsHeader
The row to test.
container
The data grid that contains the row.

See Also

DataGridTester.Row Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row Properties

The properties of the DataGridTester.Row class are listed below. For a complete list of DataGridTester.Row class members, see the DataGridTester.Row Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
TrimmedCells | The cells in the row. Whitespace has been trimmed from the front and back of the cells.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag |

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

DataGridTester.Row Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row.Tag Property

protected override NUnit.Extensions.Asp.HtmlTagTester Tag {get;}

See Also

DataGridTester.Row Class | NUnit.Extensions.Asp.AspTester Namespace


DataGridTester.Row.TrimmedCells Property

The cells in the row. Whitespace has been trimmed from the front and back of the cells.

public string[] TrimmedCells {get;}

See Also

DataGridTester.Row Class | NUnit.Extensions.Asp.AspTester Namespace


DropDownListTester Class

Tester for System.Web.UI.WebControls.DropDownList

For a list of all members of this type, see DropDownListTester Members.

System.Object
Tester
ControlTester
AspControlTester
ListControlTester
DropDownListTester

public class DropDownListTester : ListControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

DropDownListTester Members | NUnit.Extensions.Asp.AspTester Namespace


DropDownListTester Members

DropDownListTester overview

Public Instance Constructors

DropDownListTester Overloaded. Initializes a new instance of the DropDownListTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Items (inherited from ListControlTester) | The items in the list.
ListTag (inherited from ListControlTester) | A tester for the underlying HTML tag used to implement this ASP.NET control.
SelectedIndex (inherited from ListControlTester) | The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectedItem (inherited from ListControlTester) | The currently-selected item in the list.
SelectedValue (inherited from ListControlTester) | The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

DropDownListTester Class | NUnit.Extensions.Asp.AspTester Namespace


DropDownListTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public DropDownListTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public DropDownListTester(string,Tester);

See Also

DropDownListTester Class | NUnit.Extensions.Asp.AspTester Namespace


DropDownListTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public DropDownListTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

DropDownListTester Class | NUnit.Extensions.Asp.AspTester Namespace | DropDownListTester Constructor Overload List


DropDownListTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public DropDownListTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

DropDownListTester Class | NUnit.Extensions.Asp.AspTester Namespace | DropDownListTester Constructor Overload List


ImageButtonTester Class

Tester for System.Web.UI.WebControls.ImageButton

For a list of all members of this type, see ImageButtonTester Members.

System.Object
Tester
ControlTester
AspControlTester
ImageButtonTester

public class ImageButtonTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ImageButtonTester Members | NUnit.Extensions.Asp.AspTester Namespace


ImageButtonTester Members

ImageButtonTester overview

Public Instance Constructors

ImageButtonTester Overloaded. Initializes a new instance of the ImageButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Click | Overloaded. Click the button in a particular location. The 'x' coordinate of the simulated mouse click.The 'y' coordinate of the simulated mouse click.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ImageButtonTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ImageButtonTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ImageButtonTester(string,Tester);

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ImageButtonTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ImageButtonTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ImageButtonTester Constructor Overload List


ImageButtonTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ImageButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ImageButtonTester Constructor Overload List


ImageButtonTester Methods

The methods of the ImageButtonTester class are listed below. For a complete list of ImageButtonTester class members, see the ImageButtonTester Members topic.

Public Instance Methods

Click | Overloaded. Click the button in a particular location. The 'x' coordinate of the simulated mouse click.The 'y' coordinate of the simulated mouse click.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


Click Method

NUnitAsp

ImageButtonTester.Click Method

Click the button at coordinates (0, 0).

Overload List

Click the button at coordinates (0, 0).

public void Click();

Click the button in a particular location. The 'x' coordinate of the simulated mouse click.The 'y' coordinate of the simulated mouse click.

public void Click(int,int);

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ImageButtonTester.Click Method ()

Click the button at coordinates (0, 0).

public void Click();

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ImageButtonTester.Click Overload List


ImageButtonTester.Click Method (Int32, Int32)

Click the button in a particular location. The 'x' coordinate of the simulated mouse click.The 'y' coordinate of the simulated mouse click.

public void Click(
int x,
int y
);

See Also

ImageButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | ImageButtonTester.Click Overload List


LabeledControlTester Class

Abstract base class for testing controls that have associated labels, like CheckBoxTester. You can probably ignore this class.

For a list of all members of this type, see LabeledControlTester Members.

System.Object
Tester
ControlTester
AspControlTester
LabeledControlTester

public abstract class LabeledControlTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

LabeledControlTester Members | NUnit.Extensions.Asp.AspTester Namespace


LabeledControlTester Members

LabeledControlTester overview

Public Instance Constructors

LabeledControlTester Overloaded. Initializes a new instance of the LabeledControlTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabeledControlTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LabeledControlTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LabeledControlTester(string,Tester);

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabeledControlTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LabeledControlTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | LabeledControlTester Constructor Overload List


LabeledControlTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LabeledControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | LabeledControlTester Constructor Overload List


LabeledControlTester Properties

The properties of the LabeledControlTester class are listed below. For a complete list of LabeledControlTester class members, see the LabeledControlTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabeledControlTester.Text Property

Gets the text label associated with the control.

public string Text {get;}

See Also

LabeledControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabelTester Class

Tester for System.Web.UI.WebControls.Label

For a list of all members of this type, see LabelTester Members.

System.Object
Tester
ControlTester
AspControlTester
LabelTester

public class LabelTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

LabelTester Members | NUnit.Extensions.Asp.AspTester Namespace


LabelTester Members

LabelTester overview

Public Instance Constructors

LabelTester Overloaded. Initializes a new instance of the LabelTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | The text of the label.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabelTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LabelTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LabelTester(string,Tester);

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabelTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LabelTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace | LabelTester Constructor Overload List


LabelTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LabelTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace | LabelTester Constructor Overload List


LabelTester Properties

The properties of the LabelTester class are listed below. For a complete list of LabelTester class members, see the LabelTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | The text of the label.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace


LabelTester.Text Property

The text of the label.

public string Text {get;}

See Also

LabelTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester Class

Tester for System.Web.UI.WebControls.LinkButton

For a list of all members of this type, see LinkButtonTester Members.

System.Object
Tester
ControlTester
AspControlTester
LinkButtonTester

public class LinkButtonTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

LinkButtonTester Members | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester Members

LinkButtonTester overview

Public Instance Constructors

LinkButtonTester Overloaded. Initializes a new instance of the LinkButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | The text of the link.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Click | Click the link.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LinkButtonTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LinkButtonTester(string,Tester);

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public LinkButtonTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | LinkButtonTester Constructor Overload List


LinkButtonTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public LinkButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | LinkButtonTester Constructor Overload List


LinkButtonTester Properties

The properties of the LinkButtonTester class are listed below. For a complete list of LinkButtonTester class members, see the LinkButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text | The text of the link.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester.Text Property

The text of the link.

public string Text {get;}

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester Methods

The methods of the LinkButtonTester class are listed below. For a complete list of LinkButtonTester class members, see the LinkButtonTester Members topic.

Public Instance Methods

Click | Click the link.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


LinkButtonTester.Click Method

Click the link.

public void Click();

See Also

LinkButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester Class

Tester for System.Web.UI.WebControls.ListBox

For a list of all members of this type, see ListBoxTester Members.

System.Object
Tester
ControlTester
AspControlTester
ListControlTester
ListBoxTester

public class ListBoxTester : ListControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListBoxTester Members | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester Members

ListBoxTester overview

Public Instance Constructors

ListBoxTester Overloaded. Initializes a new instance of the ListBoxTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Items (inherited from ListControlTester) | The items in the list.
ListTag (inherited from ListControlTester) | A tester for the underlying HTML tag used to implement this ASP.NET control.
Rows | Gets the number of rows displayed in the System.Web.UI.WebControls.ListBox control.
SelectedIndex (inherited from ListControlTester) | The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectedItem (inherited from ListControlTester) | The currently-selected item in the list.
SelectedValue (inherited from ListControlTester) | The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectionMode | Gets the selection mode of the System.Web.UI.WebControls.ListBox control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ListBoxTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ListBoxTester(string,Tester);

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ListBoxTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | ListBoxTester Constructor Overload List


ListBoxTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ListBoxTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | ListBoxTester Constructor Overload List


ListBoxTester Properties

The properties of the ListBoxTester class are listed below. For a complete list of ListBoxTester class members, see the ListBoxTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Items (inherited from ListControlTester) | The items in the list.
ListTag (inherited from ListControlTester) | A tester for the underlying HTML tag used to implement this ASP.NET control.
Rows | Gets the number of rows displayed in the System.Web.UI.WebControls.ListBox control.
SelectedIndex (inherited from ListControlTester) | The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectedItem (inherited from ListControlTester) | The currently-selected item in the list.
SelectedValue (inherited from ListControlTester) | The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectionMode | Gets the selection mode of the System.Web.UI.WebControls.ListBox control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester.Rows Property

Gets the number of rows displayed in the System.Web.UI.WebControls.ListBox control.

public int Rows {get;}

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListBoxTester.SelectionMode Property

Gets the selection mode of the System.Web.UI.WebControls.ListBox control.

public System.Web.UI.WebControls.ListSelectionMode SelectionMode {get;}

See Also

ListBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester Class

Base class for list testers.

For a list of all members of this type, see ListControlTester Members.

System.Object
Tester
ControlTester
AspControlTester
ListControlTester

public abstract class ListControlTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListControlTester Members | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester Members

ListControlTester overview

Public Instance Constructors

ListControlTester Overloaded. Initializes a new instance of the ListControlTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Items | The items in the list.
ListTag | A tester for the underlying HTML tag used to implement this ASP.NET control.
SelectedIndex | The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectedItem | The currently-selected item in the list.
SelectedValue | The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ListControlTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ListControlTester(string,Tester);

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ListControlTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | ListControlTester Constructor Overload List


ListControlTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ListControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | ListControlTester Constructor Overload List


ListControlTester Properties

The properties of the ListControlTester class are listed below. For a complete list of ListControlTester class members, see the ListControlTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Items | The items in the list.
ListTag | A tester for the underlying HTML tag used to implement this ASP.NET control.
SelectedIndex | The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
SelectedItem | The currently-selected item in the list.
SelectedValue | The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.Items Property

The items in the list.

public NUnit.Extensions.Asp.HtmlTester.ListItemCollectionTester Items {get;}

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.ListTag Property

A tester for the underlying HTML tag used to implement this ASP.NET control.

public NUnit.Extensions.Asp.HtmlTester.HtmlSelectTester ListTag {get;}

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.SelectedIndex Property

The index of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.

public int SelectedIndex {get; set;}

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.SelectedItem Property

The currently-selected item in the list.

public NUnit.Extensions.Asp.HtmlTester.ListItemTester SelectedItem {get;}

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.SelectedValue Property

The value of the currently-selected item in the list. If this is changed and auto post-back is turned on, the form will be submitted.

public string SelectedValue {get; set;}

See Also

ListControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.IllegalInputException Class

The index of the list was set to a value that doesn't correspond to a list item. Fix the test so that it sets the value correctly, or fix the production code so that it generates the correct number of list items.

For a list of all members of this type, see ListControlTester.IllegalInputException Members.

System.Object
Exception
ApplicationException
ListControlTester.IllegalInputException

public class ListControlTester.IllegalInputException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListControlTester.IllegalInputException Members | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.IllegalInputException Members

ListControlTester.IllegalInputException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ListControlTester.IllegalInputException Class | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.NoSelectionException Class

The test asked a list what item was selected when no items were selected. Fix the test so that it doesn't ask the question, or fix the production code so that a list item is selected.

For a list of all members of this type, see ListControlTester.NoSelectionException Members.

System.Object
Exception
ApplicationException
ListControlTester.NoSelectionException

public class ListControlTester.NoSelectionException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListControlTester.NoSelectionException Members | NUnit.Extensions.Asp.AspTester Namespace


ListControlTester.NoSelectionException Members

ListControlTester.NoSelectionException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ListControlTester.NoSelectionException Class | NUnit.Extensions.Asp.AspTester Namespace


NamingContainerTester Class

Base class for testing all ASP.NET server controls that have the "naming container" property set to "true." Use this class when you're creating a custom tester for a server control that is a naming container.

For a list of all members of this type, see NamingContainerTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester

public abstract class NamingContainerTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

NamingContainerTester Members | NUnit.Extensions.Asp.AspTester Namespace


NamingContainerTester Members

NamingContainerTester overview

Public Instance Constructors

NamingContainerTester Overloaded. Initializes a new instance of the NamingContainerTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace


NamingContainerTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public NamingContainerTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public NamingContainerTester(string,Tester);

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace


NamingContainerTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public NamingContainerTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace | NamingContainerTester Constructor Overload List


NamingContainerTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public NamingContainerTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace | NamingContainerTester Constructor Overload List


NamingContainerTester Methods

The methods of the NamingContainerTester class are listed below. For a complete list of NamingContainerTester class members, see the NamingContainerTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace


NamingContainerTester.GetChildElementHtmlId Method

Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

protected internal override string GetChildElementHtmlId(
string aspId
);

See Also

NamingContainerTester Class | NUnit.Extensions.Asp.AspTester Namespace


PanelTester Class

Tester for System.Web.UI.WebControls.Panel

For a list of all members of this type, see PanelTester Members.

System.Object
Tester
ControlTester
AspControlTester
PanelTester

public class PanelTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

PanelTester Members | NUnit.Extensions.Asp.AspTester Namespace


PanelTester Members

PanelTester overview

Public Instance Constructors

PanelTester Overloaded. Initializes a new instance of the PanelTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

PanelTester Class | NUnit.Extensions.Asp.AspTester Namespace


PanelTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public PanelTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public PanelTester(string,Tester);

See Also

PanelTester Class | NUnit.Extensions.Asp.AspTester Namespace


PanelTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public PanelTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

PanelTester Class | NUnit.Extensions.Asp.AspTester Namespace | PanelTester Constructor Overload List


PanelTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public PanelTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

PanelTester Class | NUnit.Extensions.Asp.AspTester Namespace | PanelTester Constructor Overload List


RadioButtonTester Class

Tester for System.Web.UI.WebControls.RadioButton

For a list of all members of this type, see RadioButtonTester Members.

System.Object
Tester
ControlTester
AspControlTester
LabeledControlTester
RadioButtonTester

public class RadioButtonTester : LabeledControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RadioButtonTester Members | NUnit.Extensions.Asp.AspTester Namespace


RadioButtonTester Members

RadioButtonTester overview

Public Instance Constructors

RadioButtonTester Overloaded. Initializes a new instance of the RadioButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Checked | True if the radio button is checked, false if not.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
GroupName | The name of the group that the radio button is part of.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text (inherited from LabeledControlTester) | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


RadioButtonTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RadioButtonTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RadioButtonTester(string,Tester);

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


RadioButtonTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RadioButtonTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | RadioButtonTester Constructor Overload List


RadioButtonTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RadioButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace | RadioButtonTester Constructor Overload List


RadioButtonTester Properties

The properties of the RadioButtonTester class are listed below. For a complete list of RadioButtonTester class members, see the RadioButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Checked | True if the radio button is checked, false if not.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
GroupName | The name of the group that the radio button is part of.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Text (inherited from LabeledControlTester) | Gets the text label associated with the control.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


RadioButtonTester.Checked Property

True if the radio button is checked, false if not.

public bool Checked {get; set;}

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


RadioButtonTester.GroupName Property

The name of the group that the radio button is part of.

public string GroupName {get;}

See Also

RadioButtonTester Class | NUnit.Extensions.Asp.AspTester Namespace


RangeValidatorTester Class

Tester for System.Web.UI.WebControls.RangeValidator

For a list of all members of this type, see RangeValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester
RangeValidatorTester

public class RangeValidatorTester : ValidatorTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RangeValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


RangeValidatorTester Members

RangeValidatorTester overview

Public Instance Constructors

RangeValidatorTester Overloaded. Initializes a new instance of the RangeValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage (inherited from ValidatorTester) | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage (inherited from ValidatorTester) | Returns the error message, rendered to a string as a web browser would do.
SpanTag (inherited from ValidatorTester) |
Visible (inherited from ValidatorTester) | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RangeValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RangeValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RangeValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RangeValidatorTester(string,Tester);

See Also

RangeValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RangeValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RangeValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

RangeValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RangeValidatorTester Constructor Overload List


RangeValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RangeValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

RangeValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RangeValidatorTester Constructor Overload List


RegularExpressionValidatorTester Class

Tester for System.Web.UI.WebControls.RegularExpressionValidator

For a list of all members of this type, see RegularExpressionValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester
RegularExpressionValidatorTester

public class RegularExpressionValidatorTester : ValidatorTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RegularExpressionValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


RegularExpressionValidatorTester Members

RegularExpressionValidatorTester overview

Public Instance Constructors

RegularExpressionValidatorTester Overloaded. Initializes a new instance of the RegularExpressionValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage (inherited from ValidatorTester) | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage (inherited from ValidatorTester) | Returns the error message, rendered to a string as a web browser would do.
SpanTag (inherited from ValidatorTester) |
Visible (inherited from ValidatorTester) | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RegularExpressionValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RegularExpressionValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RegularExpressionValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RegularExpressionValidatorTester(string,Tester);

See Also

RegularExpressionValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RegularExpressionValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RegularExpressionValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

RegularExpressionValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RegularExpressionValidatorTester Constructor Overload List


RegularExpressionValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RegularExpressionValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

RegularExpressionValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RegularExpressionValidatorTester Constructor Overload List


RepeaterTester Class

Tester for System.Web.UI.WebControls.Repeater. Generally, you don't test through this tester. Instead, you use the Item method to use as a container for testing controls that are inside the repeater. The ItemCount method may also be useful. This example demonstrates how to test a button that's in the third item of a repeater:

            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Item(2));

For a list of all members of this type, see RepeaterTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTester

public class RepeaterTester : NamingContainerTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester Members

RepeaterTester overview

Public Instance Constructors

RepeaterTester Overloaded. Initializes a new instance of the RepeaterTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
Footer | Returns a container for testing controls within the repeater's FooterTemplate. This method will NOT check to see if the repeater is visible or if it has a FooterTemplate. Intead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
Header | Returns a container for testing controls within the repeater's HeaderTemplate. This method will NOT check to see if the repeater is visible or if it has a HeaderTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with result of this method.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
ItemCount | The number of items in the repeater. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater is invisible, this method will return zero items. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to have zero items.
Visible | Returns true if the control is visible on the current page. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater has zero items, this method will return false. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to be invisible.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Item | Returns a container for testing controls within the repeater's ItemTemplate and AlternatingItemTemplate. The 'itemNum' is the item to look for. itemNum zero is the first instance of ItemTemplate; itemNum one is the second instance of ItemTemplate, or AlternatingItemTemplate if it's in use; etc. This method does NOT check to see if the repeater is visible or if the item number is legal on the current page. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
Separator | Returns a container for testing controls within the repeater's SeparatorTemplate. The 'separatorNum' is the separator to look for. separatorNum zero is the first separator (between the first and second items); separatorNum one is the second separator (between the second and third items); etc. This method will NOT check to see if the repeater is visible or if it has a SeparatorTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | Don't call this method--repeaters don't have a single tag. Instead, all of the tags inside the repeater are rendered multiple times.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(string,Tester);

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RepeaterTester(string,bool,bool,bool);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(string,bool,bool,bool,Tester);

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace | RepeaterTester Constructor Overload List


RepeaterTester Constructor (String, Boolean, Boolean, Boolean)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RepeaterTester(
string aspId,
bool hasHeaderTemplate,
bool hasSeparatorTemplate,
bool hasFooterTemplateContainingServerControl
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
hasHeaderTemplate
"True" if the repeater being tested has a HeaderTemplate.
hasSeparatorTemplate
"True" if the repeater being tested has a SeparatorTemplate.
hasFooterTemplateContainingServerControl
Read carefully! Set this parameter to "True" only if the repeater has a FooterTemplate and the FooterTemplate contains a server control--that is, a tag with the 'runat="server"' attribute. If you do not, your tests may fail.

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace | RepeaterTester Constructor Overload List


RepeaterTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace | RepeaterTester Constructor Overload List


RepeaterTester Constructor (String, Boolean, Boolean, Boolean, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient. NOTE: This constructor assumes that the repeater being tested ONLY has ItemTemplates. If it has a SeparatorTemplate or any other template, use a different constructor.

public RepeaterTester(
string aspId,
bool hasHeaderTemplate,
bool hasSeparatorTemplate,
bool hasFooterTemplateContainingServerControl,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
hasHeaderTemplate
"True" if the repeater being tested has a HeaderTemplate.
hasSeparatorTemplate
"True" if the repeater being tested has a SeparatorTemplate.
hasFooterTemplateContainingServerControl
Read carefully! Set this parameter to "True" only if the repeater has a FooterTemplate and the FooterTemplate contains a server control--that is, a tag with the 'runat="server"' attribute. If you do not, your tests may fail.
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace | RepeaterTester Constructor Overload List


RepeaterTester Properties

The properties of the RepeaterTester class are listed below. For a complete list of RepeaterTester class members, see the RepeaterTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
Footer | Returns a container for testing controls within the repeater's FooterTemplate. This method will NOT check to see if the repeater is visible or if it has a FooterTemplate. Intead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
Header | Returns a container for testing controls within the repeater's HeaderTemplate. This method will NOT check to see if the repeater is visible or if it has a HeaderTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with result of this method.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
ItemCount | The number of items in the repeater. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater is invisible, this method will return zero items. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to have zero items.
Visible | Returns true if the control is visible on the current page. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater has zero items, this method will return false. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to be invisible.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | Don't call this method--repeaters don't have a single tag. Instead, all of the tags inside the repeater are rendered multiple times.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Footer Property

Returns a container for testing controls within the repeater's FooterTemplate. This method will NOT check to see if the repeater is visible or if it has a FooterTemplate. Intead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.

public RepeaterTester.RepeaterFooterTester Footer {get;}

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Header Property

Returns a container for testing controls within the repeater's HeaderTemplate. This method will NOT check to see if the repeater is visible or if it has a HeaderTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with result of this method.

public RepeaterTester.RepeaterHeaderTester Header {get;}

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.ItemCount Property

The number of items in the repeater. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater is invisible, this method will return zero items. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to have zero items.

public int ItemCount {get;}

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Tag Property

Don't call this method--repeaters don't have a single tag. Instead, all of the tags inside the repeater are rendered multiple times.

protected override NUnit.Extensions.Asp.HtmlTagTester Tag {get;}

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Visible Property

Returns true if the control is visible on the current page. There's no way to distinguish between a repeater that is "visible" but has zero items and a repeater that is not visible, so if the repeater has zero items, this method will return false. Similarly, if the repeater doesn't contain any server controls (controls with "runat='server'"), it will also appear to be invisible.

public override bool Visible {get;}

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester Methods

The methods of the RepeaterTester class are listed below. For a complete list of RepeaterTester class members, see the RepeaterTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Item | Returns a container for testing controls within the repeater's ItemTemplate and AlternatingItemTemplate. The 'itemNum' is the item to look for. itemNum zero is the first instance of ItemTemplate; itemNum one is the second instance of ItemTemplate, or AlternatingItemTemplate if it's in use; etc. This method does NOT check to see if the repeater is visible or if the item number is legal on the current page. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
Separator | Returns a container for testing controls within the repeater's SeparatorTemplate. The 'separatorNum' is the separator to look for. separatorNum zero is the first separator (between the first and second items); separatorNum one is the second separator (between the second and third items); etc. This method will NOT check to see if the repeater is visible or if it has a SeparatorTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.GetChildElementHtmlId Method

Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.

protected internal override string GetChildElementHtmlId(
string aspId
);

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Item Method

Returns a container for testing controls within the repeater's ItemTemplate and AlternatingItemTemplate. The 'itemNum' is the item to look for. itemNum zero is the first instance of ItemTemplate; itemNum one is the second instance of ItemTemplate, or AlternatingItemTemplate if it's in use; etc. This method does NOT check to see if the repeater is visible or if the item number is legal on the current page. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.

public RepeaterItemTester Item(
int itemNum
);

Parameters

itemNum
The item to get (zero-based)

Return Value

A container tester for the requested item

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.Separator Method

Returns a container for testing controls within the repeater's SeparatorTemplate. The 'separatorNum' is the separator to look for. separatorNum zero is the first separator (between the first and second items); separatorNum one is the second separator (between the second and third items); etc. This method will NOT check to see if the repeater is visible or if it has a SeparatorTemplate. Instead, you'll get a NotVisibleException when you attempt to use the tester instantiated with the result of this method.

public RepeaterSeparatorTester Separator(
int separatorNum
);

Parameters

separatorNum
The separator to get (zero-based)

Return Value

A container tester for the separator

See Also

RepeaterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.ContainerMustBeItemException Class

Exception: The container of the control being tested was a RepeaterTester, but it should be a RepeaterItemTester. Change "new MyTester("foo", repeater)" to "new MyTester("foo", repeater.Item(itemNum))". You may also use repeater.Header, repeater.Footer, or repeater.GetSeparator(separatorNum) as the container argument.

For a list of all members of this type, see RepeaterTester.ContainerMustBeItemException Members.

System.Object
Exception
ApplicationException
RepeaterTester.ContainerMustBeItemException

public class RepeaterTester.ContainerMustBeItemException : ApplicationException

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.ContainerMustBeItemException Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.ContainerMustBeItemException Members

RepeaterTester.ContainerMustBeItemException overview

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

RepeaterTester.ContainerMustBeItemException Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester Class

Tester for FooterTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the FooterTemplate of a repeater:

            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Footer);

For a list of all members of this type, see RepeaterTester.RepeaterFooterTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTemplateTester
RepeaterTester.RepeaterFooterTester

public class RepeaterTester.RepeaterFooterTester : RepeaterTemplateTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.RepeaterFooterTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester Members

RepeaterTester.RepeaterFooterTester overview

Public Instance Constructors

RepeaterTester.RepeaterFooterTester Constructor Create a tester for a specific item in a repeater.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester.RepeaterFooterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester Constructor

Create a tester for a specific item in a repeater.

public RepeaterTester.RepeaterFooterTester(
RepeaterTester container
);

Parameters

container
The repeater tester this item is contained within.

See Also

RepeaterTester.RepeaterFooterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester Properties

The properties of the RepeaterTester.RepeaterFooterTester class are listed below. For a complete list of RepeaterTester.RepeaterFooterTester class members, see the RepeaterTester.RepeaterFooterTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester.RepeaterFooterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester.AspId Property

The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.

public override string AspId {get;}

See Also

RepeaterTester.RepeaterFooterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterFooterTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

RepeaterTester.RepeaterFooterTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester Class

Tester for HeaderTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in a repeater's HeaderTemplate:

            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Header);

For a list of all members of this type, see RepeaterTester.RepeaterHeaderTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTemplateTester
RepeaterTester.RepeaterHeaderTester

public class RepeaterTester.RepeaterHeaderTester : RepeaterTemplateTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.RepeaterHeaderTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester Members

RepeaterTester.RepeaterHeaderTester overview

Public Instance Constructors

RepeaterTester.RepeaterHeaderTester Constructor Create a tester for a repeater's HeaderTemplate.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester.RepeaterHeaderTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester Constructor

Create a tester for a repeater's HeaderTemplate.

public RepeaterTester.RepeaterHeaderTester(
RepeaterTester container
);

Parameters

container
The repeater tester that contains this HeaderTemplate

See Also

RepeaterTester.RepeaterHeaderTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester Properties

The properties of the RepeaterTester.RepeaterHeaderTester class are listed below. For a complete list of RepeaterTester.RepeaterHeaderTester class members, see the RepeaterTester.RepeaterHeaderTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester.RepeaterHeaderTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester.AspId Property

The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.

public override string AspId {get;}

See Also

RepeaterTester.RepeaterHeaderTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterHeaderTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

RepeaterTester.RepeaterHeaderTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester Class

Tester for ItemTemplate and AlternatingItemTemplate, also known as System.Web.UI.WebControls.RepeaterItem. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the third item of a repeater:

            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Item(2));

For a list of all members of this type, see RepeaterTester.RepeaterItemTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTemplateTester
RepeaterTester.RepeaterItemTester

public class RepeaterTester.RepeaterItemTester : RepeaterTemplateTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.RepeaterItemTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester Members

RepeaterTester.RepeaterItemTester overview

Public Instance Constructors

RepeaterTester.RepeaterItemTester Constructor Create a tester for a specific item in a repeater.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester.RepeaterItemTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester Constructor

Create a tester for a specific item in a repeater.

public RepeaterTester.RepeaterItemTester(
int itemNum,
RepeaterTester container
);

Parameters

itemNum
The item number to test (zero-based).
container
The repeater tester this item is contained within.

See Also

RepeaterTester.RepeaterItemTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester Properties

The properties of the RepeaterTester.RepeaterItemTester class are listed below. For a complete list of RepeaterTester.RepeaterItemTester class members, see the RepeaterTester.RepeaterItemTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester.RepeaterItemTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester.AspId Property

The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.

public override string AspId {get;}

See Also

RepeaterTester.RepeaterItemTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterItemTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

RepeaterTester.RepeaterItemTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester Class

Tester for SeparatorTemplate. Use this tester as a container for other testers. This example demonstrates how to test a button that's in the second separator of a repeater:

            RepeaterTester repeater = new RepeaterTester("repeater");
            ButtonTester button = new ButtonTester("button", repeater.Separator(1));

For a list of all members of this type, see RepeaterTester.RepeaterSeparatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTemplateTester
RepeaterTester.RepeaterSeparatorTester

public class RepeaterTester.RepeaterSeparatorTester : RepeaterTemplateTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.RepeaterSeparatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester Members

RepeaterTester.RepeaterSeparatorTester overview

Public Instance Constructors

RepeaterTester.RepeaterSeparatorTester Constructor Create a tester for a specific item in a repeater.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester.RepeaterSeparatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester Constructor

Create a tester for a specific item in a repeater.

public RepeaterTester.RepeaterSeparatorTester(
int separatorNum,
RepeaterTester container
);

Parameters

separatorNum
The index of the separator to test (zero-based).
container
The repeater tester this item is contained within.

See Also

RepeaterTester.RepeaterSeparatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester Properties

The properties of the RepeaterTester.RepeaterSeparatorTester class are listed below. For a complete list of RepeaterTester.RepeaterSeparatorTester class members, see the RepeaterTester.RepeaterSeparatorTester Members topic.

Public Instance Properties

AspId | The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.
Description | A human-readable description of the location of the control.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from NUnit.Extensions.Asp.AspTester.RepeaterTester+RepeaterTemplateTester) |

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester.RepeaterSeparatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester.AspId Property

The ASP.NET ID of the thing being tested. For Repeater templates, it is automatically generated.

public override string AspId {get;}

See Also

RepeaterTester.RepeaterSeparatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterSeparatorTester.Description Property

A human-readable description of the location of the control.

public override string Description {get;}

See Also

RepeaterTester.RepeaterSeparatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterTemplateTester Class

Base class for all repeater template testers. This is an implementation detail and can be ignored.

For a list of all members of this type, see RepeaterTester.RepeaterTemplateTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
RepeaterTester.RepeaterTemplateTester

public abstract class RepeaterTester.RepeaterTemplateTester : NamingContainerTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RepeaterTester.RepeaterTemplateTester Members | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterTemplateTester Members

RepeaterTester.RepeaterTemplateTester overview

Public Instance Constructors

RepeaterTester.RepeaterTemplateTester Constructor Create a tester for a specific template in a repeater.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | Don't call this method--repeaters aren't rendered as tags. They're just naming containers for their contents.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RepeaterTester.RepeaterTemplateTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterTemplateTester Constructor

Create a tester for a specific template in a repeater.

public RepeaterTester.RepeaterTemplateTester(
RepeaterTester container
);

Parameters

container
The repeater tester this item is contained within.

See Also

RepeaterTester.RepeaterTemplateTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterTemplateTester Properties

The properties of the RepeaterTester.RepeaterTemplateTester class are listed below. For a complete list of RepeaterTester.RepeaterTemplateTester class members, see the RepeaterTester.RepeaterTemplateTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag | Don't call this method--repeaters aren't rendered as tags. They're just naming containers for their contents.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

RepeaterTester.RepeaterTemplateTester Class | NUnit.Extensions.Asp.AspTester Namespace


RepeaterTester.RepeaterTemplateTester.Tag Property

Don't call this method--repeaters aren't rendered as tags. They're just naming containers for their contents.

protected override NUnit.Extensions.Asp.HtmlTagTester Tag {get;}

See Also

RepeaterTester.RepeaterTemplateTester Class | NUnit.Extensions.Asp.AspTester Namespace


RequiredFieldValidatorTester Class

Tester for System.Web.UI.WebControls.RequiredFieldValidator

For a list of all members of this type, see RequiredFieldValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester
RequiredFieldValidatorTester

public class RequiredFieldValidatorTester : ValidatorTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

RequiredFieldValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


RequiredFieldValidatorTester Members

RequiredFieldValidatorTester overview

Public Instance Constructors

RequiredFieldValidatorTester Overloaded. Initializes a new instance of the RequiredFieldValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage (inherited from ValidatorTester) | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage (inherited from ValidatorTester) | Returns the error message, rendered to a string as a web browser would do.
SpanTag (inherited from ValidatorTester) |
Visible (inherited from ValidatorTester) | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

RequiredFieldValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RequiredFieldValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RequiredFieldValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RequiredFieldValidatorTester(string,Tester);

See Also

RequiredFieldValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


RequiredFieldValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public RequiredFieldValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

RequiredFieldValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RequiredFieldValidatorTester Constructor Overload List


RequiredFieldValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public RequiredFieldValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

RequiredFieldValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | RequiredFieldValidatorTester Constructor Overload List


TextBoxTester Class

Tester for System.Web.UI.WebControls.TextBox

For a list of all members of this type, see TextBoxTester Members.

System.Object
Tester
ControlTester
AspControlTester
TextBoxTester

public class TextBoxTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

TextBoxTester Members | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester Members

TextBoxTester overview

Public Instance Constructors

TextBoxTester Overloaded. Initializes a new instance of the TextBoxTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
MaxLength | Maximum number of characters to display in the text box. Returns 0 if there is no max length.
Text | The text in the text box.
TextMode | The kind of text box.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public TextBoxTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public TextBoxTester(string,Tester);

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public TextBoxTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | TextBoxTester Constructor Overload List


TextBoxTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public TextBoxTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace | TextBoxTester Constructor Overload List


TextBoxTester Properties

The properties of the TextBoxTester class are listed below. For a complete list of TextBoxTester class members, see the TextBoxTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
MaxLength | Maximum number of characters to display in the text box. Returns 0 if there is no max length.
Text | The text in the text box.
TextMode | The kind of text box.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester.MaxLength Property

Maximum number of characters to display in the text box. Returns 0 if there is no max length.

public int MaxLength {get;}

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester.Text Property

The text in the text box.

public string Text {get; set;}

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


TextBoxTester.TextMode Property

The kind of text box.

public System.Web.UI.WebControls.TextBoxMode TextMode {get;}

See Also

TextBoxTester Class | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester Class

Tester for System.Web.UI.UserControl

For a list of all members of this type, see UserControlTester Members.

System.Object
Tester
ControlTester
AspControlTester
NamingContainerTester
UserControlTester

public class UserControlTester : NamingContainerTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

UserControlTester Members | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester Members

UserControlTester overview

Public Instance Constructors

UserControlTester Overloaded. Initializes a new instance of the UserControlTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible | Visibility of user controls cannot be determined. This method always throws an exception.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled |
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from NamingContainerTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public UserControlTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public UserControlTester(string,Tester);

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public UserControlTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | UserControlTester Constructor Overload List


UserControlTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public UserControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace | UserControlTester Constructor Overload List


UserControlTester Properties

The properties of the UserControlTester class are listed below. For a complete list of UserControlTester class members, see the UserControlTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Visible | Visibility of user controls cannot be determined. This method always throws an exception.

Protected Instance Properties

IsDisabled |
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester.IsDisabled Property

protected override bool IsDisabled {get;}

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


UserControlTester.Visible Property

Visibility of user controls cannot be determined. This method always throws an exception.

public override bool Visible {get;}

See Also

UserControlTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidationSummaryTester Class

Tester for System.Web.UI.WebControls.ValidationSummary

For a list of all members of this type, see ValidationSummaryTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidationSummaryTester

public class ValidationSummaryTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ValidationSummaryTester Members | NUnit.Extensions.Asp.AspTester Namespace


ValidationSummaryTester Members

ValidationSummaryTester overview

Public Instance Constructors

ValidationSummaryTester Overloaded. Initializes a new instance of the ValidationSummaryTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Messages | The messages in the validation summary.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidationSummaryTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ValidationSummaryTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ValidationSummaryTester(string,Tester);

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidationSummaryTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ValidationSummaryTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace | ValidationSummaryTester Constructor Overload List


ValidationSummaryTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ValidationSummaryTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebForm currentWebForm = new WebForm(myHttpClient);
            LabelTester myTester = new LabelTester("id", currentWebForm);

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace | ValidationSummaryTester Constructor Overload List


ValidationSummaryTester Properties

The properties of the ValidationSummaryTester class are listed below. For a complete list of ValidationSummaryTester class members, see the ValidationSummaryTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
Messages | The messages in the validation summary.
Visible (inherited from Tester) | Returns true if the control is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidationSummaryTester.Messages Property

The messages in the validation summary.

public string[] Messages {get;}

See Also

ValidationSummaryTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester Class

Base class for all validator testers.

For a list of all members of this type, see ValidatorTester Members.

System.Object
Tester
ControlTester
AspControlTester
ValidatorTester

public class ValidatorTester : AspControlTester

Requirements

Namespace: NUnit.Extensions.Asp.AspTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ValidatorTester Members | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester Members

ValidatorTester overview

Public Instance Constructors

ValidatorTester Overloaded. Initializes a new instance of the ValidatorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage | Returns the error message, rendered to a string as a web browser would do.
SpanTag |
Visible | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
GenerateAnonymousId (inherited from AspControlTester) | Creates an ID for a control that doesn't have one provided in the .aspx page. The tester using this method must algorithmically determine what number ASP.NET provided to the control. In other words, control number "3" turns into an ID of "ctl03" in ASP.NET 2.0 and "_ctl3" in ASP.NET 1.x.
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester Constructor

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

Overload List

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ValidatorTester(string);

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ValidatorTester(string,Tester);

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester Constructor (String)

Create a tester for a top-level control. Use this constructor for testing most controls. Testers created with this constructor will test pages loaded by the Default HttpClient.

public ValidatorTester(
string aspId
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | ValidatorTester Constructor Overload List


ValidatorTester Constructor (String, Tester)

Create a tester for a nested control. Use this constructor when the control you are testing is nested within another control, such as a DataGrid or UserControl. You should also use this constructor when you're not using the Default HttpClient.

public ValidatorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.)

Example

This example demonstrates how to test a label that's inside of a user control:

            UserControlTester user1 = new UserControlTester("user1");
            LabelTester label = new LabelTester("label", user1);
This example demonstrates how to use an HttpClient other than Default:
            HttpClient myHttpClient = new HttpClient();
            WebFormTester webForm = new WebFormTester(myHttpClient);
            LabelTester myTester = new LabelTester("id", webForm);

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace | ValidatorTester Constructor Overload List


ValidatorTester Properties

The properties of the ValidatorTester class are listed below. For a complete list of ValidatorTester class members, see the ValidatorTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
Description (inherited from ControlTester) | A human-readable description of the location of the control. Unlike HtmlIdAndDescription, this property only describes the location of the control in the ASP.NET source code.
Enabled (inherited from AspControlTester) | True if the control is enabled.
ErrorMessage | Returns the error message.
HtmlId (inherited from ControlTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
RenderedErrorMessage | Returns the error message, rendered to a string as a web browser would do.
SpanTag |
Visible | Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from Tester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester.ErrorMessage Property

Returns the error message.

public string ErrorMessage {get;}

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester.RenderedErrorMessage Property

Returns the error message, rendered to a string as a web browser would do.

public string RenderedErrorMessage {get;}

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester.SpanTag Property

public NUnit.Extensions.Asp.HtmlTester.HtmlSpanTester SpanTag {get;}

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


ValidatorTester.Visible Property

Unlike most controls, this control returns 'true' only if the validator is actually visible to the user.

public override bool Visible {get;}

See Also

ValidatorTester Class | NUnit.Extensions.Asp.AspTester Namespace


NUnit.Extensions.Asp.HtmlTester

NUnitAsp

NUnit.Extensions.Asp.HtmlTester Namespace

Classes

Class | Description
AnchorTester | This class is obsolete and will be dropped in future releases of NUnitAsp. Please use HtmlAnchorTester instead.
HtmlAnchorTester | Tester for System.Web.UI.HtmlControls.HtmlAnchor
HtmlButtonTester | Tester for System.Web.UI.HtmlControls.HtmlButton
HtmlControlTester | Base class for all testers in HtmlTester namespace
HtmlInputButtonTester | Tester for System.Web.UI.HtmlControls.HtmlInputButton
HtmlInputCheckBoxTester | Tester for the System.Web.UI.HtmlControls.HtmlInputCheckBox control.
HtmlInputHidden | Tester for System.Web.UI.HtmlControls.HtmlInputHidden
HtmlInputImageTester | Tester for System.Web.UI.HtmlControls.HtmlInputImage
HtmlInputRadioButtonTester | Tester for System.Web.UI.HtmlControls.HtmlInputRadioButton
HtmlInputRadioButtonTester.CannotUncheckException | Test attempted to set radio button's Checked property to false, but radio buttons cannot be unchecked directly. Check another radio button in the same group instead.
HtmlInputTextTester | Tester for System.Web.UI.HtmlControls.HtmlInputText
HtmlSelectTester | Tester for System.Web.UI.HtmlControls.HtmlSelect
HtmlSpanTester | Tester for HTML <span> tag.
HtmlTableTester | Tester for System.Web.UI.HtmlControls.HtmlTable
HtmlTextAreaTester | Tester for System.Web.UI.HtmlControls.HtmlTextArea
ListItemCollectionTester | Tester for System.Web.UI.WebControls.ListItemCollection
ListItemTester | Tester for System.Web.UI.WebControls.ListItem


AnchorTester Class

This class is obsolete and will be dropped in future releases of NUnitAsp. Please use HtmlAnchorTester instead.

For a list of all members of this type, see AnchorTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlAnchorTester
AnchorTester

public class AnchorTester : HtmlAnchorTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

AnchorTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


AnchorTester Members

AnchorTester overview

Public Instance Constructors

AnchorTester Constructor Create the tester and link it to an ASP.NET control.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HRef (inherited from HtmlAnchorTester) | The HRef of the link.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
PopupLink (inherited from HtmlAnchorTester) | The HRef of the pop-up window's link. Null if this anchor doesn't have a recognizable pop-up link.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click (inherited from HtmlAnchorTester) | Click the link. Supports postback and pop-up windows.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

AnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


AnchorTester Constructor

Create the tester and link it to an ASP.NET control.

public AnchorTester(
string aspId,
Tester container,
bool runAtServer
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container. Use CurrentWebForm if the control is just nested in the form tag.)
runAtServer
Tells tester whether the control under test is running on the server side.

See Also

AnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester Class

Tester for System.Web.UI.HtmlControls.HtmlAnchor

For a list of all members of this type, see HtmlAnchorTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlAnchorTester

public class HtmlAnchorTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlAnchorTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester Members

HtmlAnchorTester overview

Public Instance Constructors

HtmlAnchorTester Overloaded. Initializes a new instance of the HtmlAnchorTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HRef | The HRef of the link.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
PopupLink | The HRef of the pop-up window's link. Null if this anchor doesn't have a recognizable pop-up link.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Click the link. Supports postback and pop-up windows.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlAnchorTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlAnchorTester(string,Tester);

public HtmlAnchorTester(string,Tester,bool);

Create a tester for an HTML tag using an XPath description.

public HtmlAnchorTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlAnchorTester(string,string,Tester);

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlAnchorTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlAnchorTester Constructor Overload List


HtmlAnchorTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlAnchorTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlAnchorTester Constructor Overload List


HtmlAnchorTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlAnchorTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlAnchorTester Constructor Overload List


HtmlAnchorTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlAnchorTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlAnchorTester Constructor Overload List


HtmlAnchorTester Constructor (String, Tester, Boolean)

public HtmlAnchorTester(
string aspId,
Tester container,
bool runAtServer
);

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlAnchorTester Constructor Overload List


HtmlAnchorTester Properties

The properties of the HtmlAnchorTester class are listed below. For a complete list of HtmlAnchorTester class members, see the HtmlAnchorTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HRef | The HRef of the link.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
PopupLink | The HRef of the pop-up window's link. Null if this anchor doesn't have a recognizable pop-up link.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester.HRef Property

The HRef of the link.

public string HRef {get;}

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester.PopupLink Property

The HRef of the pop-up window's link. Null if this anchor doesn't have a recognizable pop-up link.

public string PopupLink {get;}

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester Methods

The methods of the HtmlAnchorTester class are listed below. For a complete list of HtmlAnchorTester class members, see the HtmlAnchorTester Members topic.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Click the link. Supports postback and pop-up windows.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlAnchorTester.Click Method

Click the link. Supports postback and pop-up windows.

public void Click();

See Also

HtmlAnchorTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester Class

Tester for System.Web.UI.HtmlControls.HtmlButton

For a list of all members of this type, see HtmlButtonTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlButtonTester

public class HtmlButtonTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlButtonTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester Members

HtmlButtonTester overview

Public Instance Constructors

HtmlButtonTester Overloaded. Initializes a new instance of the HtmlButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Text | Get the text on the button
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Click the button.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlButtonTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlButtonTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlButtonTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlButtonTester(string,string,Tester);

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlButtonTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlButtonTester Constructor Overload List


HtmlButtonTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlButtonTester Constructor Overload List


HtmlButtonTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlButtonTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlButtonTester Constructor Overload List


HtmlButtonTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlButtonTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlButtonTester Constructor Overload List


HtmlButtonTester Properties

The properties of the HtmlButtonTester class are listed below. For a complete list of HtmlButtonTester class members, see the HtmlButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Text | Get the text on the button
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester.Text Property

Get the text on the button

public virtual string Text {get;}

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester Methods

The methods of the HtmlButtonTester class are listed below. For a complete list of HtmlButtonTester class members, see the HtmlButtonTester Members topic.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Click the button.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlButtonTester.Click Method

Click the button.

public void Click();

See Also

HtmlButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlControlTester Class

Base class for all testers in HtmlTester namespace

For a list of all members of this type, see HtmlControlTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester

public abstract class HtmlControlTester : HtmlTagTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlControlTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlControlTester Members

HtmlControlTester overview

Public Instance Constructors

HtmlControlTester Overloaded. Initializes a new instance of the HtmlControlTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlControlTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlControlTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlControlTester(string,Tester);

Create the tester and link it to an ASP.NET control.

public HtmlControlTester(string,Tester,bool);

Create a tester for an HTML tag using an XPath description.

public HtmlControlTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlControlTester(string,string,Tester);

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlControlTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlControlTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlControlTester Constructor Overload List


HtmlControlTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlControlTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlControlTester Constructor Overload List


HtmlControlTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlControlTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlControlTester Constructor Overload List


HtmlControlTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlControlTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlControlTester Constructor Overload List


HtmlControlTester Constructor (String, Tester, Boolean)

Create the tester and link it to an ASP.NET control.

public HtmlControlTester(
string aspId,
Tester container,
bool runAtServer
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container. Use CurrentWebForm if the control is just nested in the form tag.)
runAtServer
Tells tester whether the control under test is running on the server side.

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlControlTester Constructor Overload List


HtmlControlTester Properties

The properties of the HtmlControlTester class are listed below. For a complete list of HtmlControlTester class members, see the HtmlControlTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlControlTester.Disabled Property

Gets or sets a value indicating wheither the control is disabled.

public bool Disabled {get;}

See Also

HtmlControlTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputButtonTester Class

Tester for System.Web.UI.HtmlControls.HtmlInputButton

For a list of all members of this type, see HtmlInputButtonTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlButtonTester
HtmlInputButtonTester

public class HtmlInputButtonTester : HtmlButtonTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputButtonTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputButtonTester Members

HtmlInputButtonTester overview

Public Instance Constructors

HtmlInputButtonTester Overloaded. Initializes a new instance of the HtmlInputButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Text | Get the text on the button
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click (inherited from HtmlButtonTester) | Click the button.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputButtonTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputButtonTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputButtonTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputButtonTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputButtonTester(string,string,Tester);

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputButtonTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputButtonTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputButtonTester Constructor Overload List


HtmlInputButtonTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputButtonTester Constructor Overload List


HtmlInputButtonTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputButtonTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputButtonTester Constructor Overload List


HtmlInputButtonTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputButtonTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputButtonTester Constructor Overload List


HtmlInputButtonTester Properties

The properties of the HtmlInputButtonTester class are listed below. For a complete list of HtmlInputButtonTester class members, see the HtmlInputButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Text | Get the text on the button
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputButtonTester.Text Property

Get the text on the button

public override string Text {get;}

See Also

HtmlInputButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputCheckBoxTester Class

Tester for the System.Web.UI.HtmlControls.HtmlInputCheckBox control.

For a list of all members of this type, see HtmlInputCheckBoxTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlInputCheckBoxTester

public class HtmlInputCheckBoxTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputCheckBoxTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputCheckBoxTester Members

HtmlInputCheckBoxTester overview

Public Instance Constructors

HtmlInputCheckBoxTester Overloaded. Initializes a new instance of the HtmlInputCheckBoxTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Checked |
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputCheckBoxTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputCheckBoxTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputCheckBoxTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputCheckBoxTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputCheckBoxTester(string,string,Tester);

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputCheckBoxTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputCheckBoxTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputCheckBoxTester Constructor Overload List


HtmlInputCheckBoxTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputCheckBoxTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputCheckBoxTester Constructor Overload List


HtmlInputCheckBoxTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputCheckBoxTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputCheckBoxTester Constructor Overload List


HtmlInputCheckBoxTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputCheckBoxTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputCheckBoxTester Constructor Overload List


HtmlInputCheckBoxTester Properties

The properties of the HtmlInputCheckBoxTester class are listed below. For a complete list of HtmlInputCheckBoxTester class members, see the HtmlInputCheckBoxTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Checked |
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputCheckBoxTester.Checked Property

public bool Checked {get; set;}

See Also

HtmlInputCheckBoxTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputHidden Class

Tester for System.Web.UI.HtmlControls.HtmlInputHidden

For a list of all members of this type, see HtmlInputHidden Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlInputHidden

public class HtmlInputHidden : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputHidden Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputHidden Members

HtmlInputHidden overview

Public Instance Constructors

HtmlInputHidden Overloaded. Initializes a new instance of the HtmlInputHidden class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputHidden Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputHidden(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputHidden(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputHidden(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputHidden(string,string,Tester);

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputHidden Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputHidden(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputHidden Constructor Overload List


HtmlInputHidden Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputHidden(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputHidden Constructor Overload List


HtmlInputHidden Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputHidden(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputHidden Constructor Overload List


HtmlInputHidden Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputHidden(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputHidden Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputHidden Constructor Overload List


HtmlInputImageTester Class

Tester for System.Web.UI.HtmlControls.HtmlInputImage

For a list of all members of this type, see HtmlInputImageTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlInputImageTester

public class HtmlInputImageTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputImageTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputImageTester Members

HtmlInputImageTester overview

Public Instance Constructors

HtmlInputImageTester Overloaded. Initializes a new instance of the HtmlInputImageTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Overloaded. Click the image button in the upper-left corner (coordinates '0, 0').
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputImageTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputImageTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputImageTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputImageTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputImageTester(string,string,Tester);

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputImageTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputImageTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester Constructor Overload List


HtmlInputImageTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputImageTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester Constructor Overload List


HtmlInputImageTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputImageTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester Constructor Overload List


HtmlInputImageTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputImageTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester Constructor Overload List


HtmlInputImageTester Methods

The methods of the HtmlInputImageTester class are listed below. For a complete list of HtmlInputImageTester class members, see the HtmlInputImageTester Members topic.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Click | Overloaded. Click the image button in the upper-left corner (coordinates '0, 0').
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


Click Method

NUnitAsp

HtmlInputImageTester.Click Method

Click the image button in the upper-left corner (coordinates '0, 0').

Overload List

Click the image button in the upper-left corner (coordinates '0, 0').

public void Click();

Click the image button at the specified coordinates.

public void Click(int,int);

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputImageTester.Click Method ()

Click the image button in the upper-left corner (coordinates '0, 0').

public void Click();

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester.Click Overload List


HtmlInputImageTester.Click Method (Int32, Int32)

Click the image button at the specified coordinates.

public void Click(
int x,
int y
);

See Also

HtmlInputImageTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputImageTester.Click Overload List


HtmlInputRadioButtonTester Class

Tester for System.Web.UI.HtmlControls.HtmlInputRadioButton

For a list of all members of this type, see HtmlInputRadioButtonTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlInputRadioButtonTester

public class HtmlInputRadioButtonTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputRadioButtonTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester Members

HtmlInputRadioButtonTester overview

Public Instance Constructors

HtmlInputRadioButtonTester Overloaded. Initializes a new instance of the HtmlInputRadioButtonTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Checked | 'True' if the radio button is checked; 'false' if not. Set this parameter to change the radio button value on post-back. Only one radio button in the same group (that is, with the same 'name' attribute) may be checked at any given time. If you set this radio button to true, any other radio buttons that are checked will be unchecked.
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputRadioButtonTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputRadioButtonTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputRadioButtonTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputRadioButtonTester(string,string,Tester);

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputRadioButtonTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputRadioButtonTester Constructor Overload List


HtmlInputRadioButtonTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputRadioButtonTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputRadioButtonTester Constructor Overload List


HtmlInputRadioButtonTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputRadioButtonTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputRadioButtonTester Constructor Overload List


HtmlInputRadioButtonTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputRadioButtonTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputRadioButtonTester Constructor Overload List


HtmlInputRadioButtonTester Properties

The properties of the HtmlInputRadioButtonTester class are listed below. For a complete list of HtmlInputRadioButtonTester class members, see the HtmlInputRadioButtonTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Checked | 'True' if the radio button is checked; 'false' if not. Set this parameter to change the radio button value on post-back. Only one radio button in the same group (that is, with the same 'name' attribute) may be checked at any given time. If you set this radio button to true, any other radio buttons that are checked will be unchecked.
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester.Checked Property

'True' if the radio button is checked; 'false' if not. Set this parameter to change the radio button value on post-back. Only one radio button in the same group (that is, with the same 'name' attribute) may be checked at any given time. If you set this radio button to true, any other radio buttons that are checked will be unchecked.

public bool Checked {get; set;}

See Also

HtmlInputRadioButtonTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester.CannotUncheckException Class

Test attempted to set radio button's Checked property to false, but radio buttons cannot be unchecked directly. Check another radio button in the same group instead.

For a list of all members of this type, see HtmlInputRadioButtonTester.CannotUncheckException Members.

System.Object
Exception
SystemException
InvalidOperationException
HtmlInputRadioButtonTester.CannotUncheckException

public class HtmlInputRadioButtonTester.CannotUncheckException : InvalidOperationException

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputRadioButtonTester.CannotUncheckException Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester.CannotUncheckException Members

HtmlInputRadioButtonTester.CannotUncheckException overview

Public Instance Constructors

HtmlInputRadioButtonTester.CannotUncheckException Constructor Initializes a new instance of the CannotUncheckException class.

Public Instance Properties

HelpLink (inherited from Exception)
InnerException (inherited from Exception)
Message (inherited from Exception)
Source (inherited from Exception)
StackTrace (inherited from Exception)
TargetSite (inherited from Exception)

Public Instance Methods

Equals (inherited from Object)
GetBaseException (inherited from Exception)
GetHashCode (inherited from Object)
GetObjectData (inherited from Exception)
GetType (inherited from Object)
ToString (inherited from Exception)

Protected Instance Properties

HResult (inherited from Exception)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

HtmlInputRadioButtonTester.CannotUncheckException Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputRadioButtonTester.CannotUncheckException Constructor

Initializes a new instance of the CannotUncheckException class.

public HtmlInputRadioButtonTester.CannotUncheckException();

See Also

HtmlInputRadioButtonTester.CannotUncheckException Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputTextTester Class

Tester for System.Web.UI.HtmlControls.HtmlInputText

For a list of all members of this type, see HtmlInputTextTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlInputTextTester

public class HtmlInputTextTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlInputTextTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputTextTester Members

HtmlInputTextTester overview

Public Instance Constructors

HtmlInputTextTester Overloaded. Initializes a new instance of the HtmlInputTextTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Size | Return the width in columns of the text field, or -1 if undefined (default).
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputTextTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputTextTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputTextTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlInputTextTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputTextTester(string,string,Tester);

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputTextTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlInputTextTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputTextTester Constructor Overload List


HtmlInputTextTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlInputTextTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputTextTester Constructor Overload List


HtmlInputTextTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlInputTextTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputTextTester Constructor Overload List


HtmlInputTextTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlInputTextTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlInputTextTester Constructor Overload List


HtmlInputTextTester Properties

The properties of the HtmlInputTextTester class are listed below. For a complete list of HtmlInputTextTester class members, see the HtmlInputTextTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Size | Return the width in columns of the text field, or -1 if undefined (default).
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlInputTextTester.Size Property

Return the width in columns of the text field, or -1 if undefined (default).

public int Size {get;}

See Also

HtmlInputTextTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester Class

Tester for System.Web.UI.HtmlControls.HtmlSelect

For a list of all members of this type, see HtmlSelectTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlSelectTester

public class HtmlSelectTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlSelectTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester Members

HtmlSelectTester overview

Public Instance Constructors

HtmlSelectTester Overloaded. Initializes a new instance of the HtmlSelectTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Items | The options in this select tag, rendered as ListItemTesters in order to be consistent with ASP.NET.
Multiple | Whether the 'multiple-select' attribute has been set.
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
OptionTags | The <option> tags contained within this <select> tag.
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
RenderedItems | The text of all of the options for this list box, rendered as strings.
SelectedIndex | The index of the currently-selected option
Size | The number of rows specified for the browser to display, or '1' if not specified.
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

ChangeItemSelectState | For internal use only.
EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlSelectTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlSelectTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlSelectTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlSelectTester(string,string,Tester);

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlSelectTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSelectTester Constructor Overload List


HtmlSelectTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlSelectTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSelectTester Constructor Overload List


HtmlSelectTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlSelectTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSelectTester Constructor Overload List


HtmlSelectTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlSelectTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSelectTester Constructor Overload List


HtmlSelectTester Properties

The properties of the HtmlSelectTester class are listed below. For a complete list of HtmlSelectTester class members, see the HtmlSelectTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Items | The options in this select tag, rendered as ListItemTesters in order to be consistent with ASP.NET.
Multiple | Whether the 'multiple-select' attribute has been set.
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
OptionTags | The <option> tags contained within this <select> tag.
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
RenderedItems | The text of all of the options for this list box, rendered as strings.
SelectedIndex | The index of the currently-selected option
Size | The number of rows specified for the browser to display, or '1' if not specified.
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.Items Property

The options in this select tag, rendered as ListItemTesters in order to be consistent with ASP.NET.

public ListItemCollectionTester Items {get;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.Multiple Property

Whether the 'multiple-select' attribute has been set.

public bool Multiple {get;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.OptionTags Property

The <option> tags contained within this <select> tag.

public NUnit.Extensions.Asp.HtmlTagTester[] OptionTags {get;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.RenderedItems Property

The text of all of the options for this list box, rendered as strings.

public string[] RenderedItems {get;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.SelectedIndex Property

The index of the currently-selected option

public int SelectedIndex {get; set;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.Size Property

The number of rows specified for the browser to display, or '1' if not specified.

public int Size {get;}

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester Methods

The methods of the HtmlSelectTester class are listed below. For a complete list of HtmlSelectTester class members, see the HtmlSelectTester Members topic.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Methods

ChangeItemSelectState | For internal use only.
EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSelectTester.ChangeItemSelectState Method

For internal use only.

protected internal void ChangeItemSelectState(
ListItemTester item,
bool selected
);

See Also

HtmlSelectTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSpanTester Class

Tester for HTML <span> tag.

For a list of all members of this type, see HtmlSpanTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlSpanTester

public class HtmlSpanTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlSpanTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSpanTester Members

HtmlSpanTester overview

Public Instance Constructors

HtmlSpanTester Overloaded. Initializes a new instance of the HtmlSpanTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSpanTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlSpanTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlSpanTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlSpanTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlSpanTester(string,string,Tester);

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlSpanTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlSpanTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSpanTester Constructor Overload List


HtmlSpanTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlSpanTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSpanTester Constructor Overload List


HtmlSpanTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlSpanTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSpanTester Constructor Overload List


HtmlSpanTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlSpanTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlSpanTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlSpanTester Constructor Overload List


HtmlTableTester Class

Tester for System.Web.UI.HtmlControls.HtmlTable

For a list of all members of this type, see HtmlTableTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlTableTester

public class HtmlTableTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlTableTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester Members

HtmlTableTester overview

Public Instance Constructors

HtmlTableTester Overloaded. Initializes a new instance of the HtmlTableTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Cells | An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML document (equivalent to calling "InnerHtml" on every cell).
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedCells | An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate how they will be displayed by a browser (equivalent to calling "InnerHtmlRendered" on every cell).
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Rows |
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTableTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTableTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlTableTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTableTester(string,string,Tester);

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTableTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTableTester Constructor Overload List


HtmlTableTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTableTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTableTester Constructor Overload List


HtmlTableTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlTableTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTableTester Constructor Overload List


HtmlTableTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTableTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTableTester Constructor Overload List


HtmlTableTester Properties

The properties of the HtmlTableTester class are listed below. For a complete list of HtmlTableTester class members, see the HtmlTableTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Cells | An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML document (equivalent to calling "InnerHtml" on every cell).
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedCells | An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate how they will be displayed by a browser (equivalent to calling "InnerHtmlRendered" on every cell).
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Rows |
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester.Cells Property

An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are returned exactly as they are found in the HTML document (equivalent to calling "InnerHtml" on every cell).

public string[][] Cells {get;}

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester.RenderedCells Property

An array of string arrays containing the contents of the table, not counting the header. The outer array represents rows and the inner arrays represents cells within the rows. The cells are "rendered" to approximate how they will be displayed by a browser (equivalent to calling "InnerHtmlRendered" on every cell).

public string[][] RenderedCells {get;}

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTableTester.Rows Property

public NUnit.Extensions.Asp.HtmlTagTester[] Rows {get;}

See Also

HtmlTableTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester Class

Tester for System.Web.UI.HtmlControls.HtmlTextArea

For a list of all members of this type, see HtmlTextAreaTester Members.

System.Object
Tester
ControlTester
HtmlTagTester
HtmlControlTester
HtmlTextAreaTester

public class HtmlTextAreaTester : HtmlControlTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

HtmlTextAreaTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester Members

HtmlTextAreaTester overview

Public Instance Constructors

HtmlTextAreaTester Overloaded. Initializes a new instance of the HtmlTextAreaTester class.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Cols | Return the width of the text area in columns, or -1 if undefined (default)
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Rows | Return the height of the text area in rows, or -1 if undefined (default).
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Public Instance Methods

Attribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or throws an exception if the attribute isn't present.
AttributeAsIntWithNegOneDefault (inherited from HtmlTagTester) | Returns an attribute as an integer, or -1 if the attribute isn't present. Throws an exception if the attribute isn't an integer.
Child (inherited from HtmlTagTester) | Returns the only child (of a particular type) of this tag. If this tag has more that one child of the requested type, or if it has no children of the requested type, this method will throw an exception. Don't cache the results of this call.
Children (inherited from HtmlTagTester) | Returns the immediate children of this tag that match a particular type (such as <tr>). Does not return "grand-children" -- i.e., calling table.Children("tr") will work, but calling table.Children("td") will typically return nothing because the 'td' tags are nested inside 'tr' tags.Don't cache the results of this call.
ChildrenByXPath (inherited from HtmlTagTester) | Returns the tags that match an XPath expression, starting from this tag (node). Make sure that the result of your expression is a set of tags.Don't cache the results of this call.
Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
HasAttribute (inherited from HtmlTagTester) | Returns true if this tag has the specified attribute.
HasChildren (inherited from HtmlTagTester) | Returns 'true' if this tag has any immediate children that match a particular type (such as <tr>. Does not check "grand-children" -- i.e., calling table.HasChildren("tr") will usually return true and calling table.HasChildren("td") will usually return false.
OptionalAttribute (inherited from HtmlTagTester) | Returns the value of an attribute on this tag or null if the attribute isn't present.
ToString (inherited from Tester) | Provides a friendly message reminding users not to put testers in assertions.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Instance Methods

AssertVisible (inherited from Tester) | Experimental. May change or go away in future revisions. Allows testers to assert that their control should be visible before some operations. Using this method provides clearer error messages to users of the tester.
Finalize (inherited from Object) |
IsPostBack (inherited from ControlTester) | Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
MemberwiseClone (inherited from Object) |
OptionalPostBack (inherited from ControlTester) | Like PostBack, but doesn't fail if candidatePostBackScript doesn't contain a post-back script.
PostBack (inherited from ControlTester) | Overloaded. Trigger a post-back. ASP.NET has a post-back idiom that often shows up as a Javascript "__doPostBack" call. This method exists to make it easy to write testers for controls that do so. Just take the string that contains the post- back script and pass it to this method. Use OptionalPostBack if the script isn't always present.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

Protected Internal Instance Methods

EnterInputValue (inherited from ControlTester) |
GetChildElementHtmlId (inherited from ControlTester) | Returns the HTML ID of a child control. Useful when implementing testers for container controls that do HTML ID mangling. This method is very likely to change in a future release.
RemoveInputValue (inherited from ControlTester) |
Submit (inherited from ControlTester) | Post the form containing this control to the server.

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester Constructor

Create a tester for an HTML tag. Use this constructor for testing most tags.

Overload List

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTextAreaTester(string);

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTextAreaTester(string,Tester);

Create a tester for an HTML tag using an XPath description.

public HtmlTextAreaTester(string,string);

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTextAreaTester(string,string,Tester);

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester Constructor (String)

Create a tester for an HTML tag. Use this constructor for testing most tags.

public HtmlTextAreaTester(
string htmlId
);

Parameters

htmlId
The ID of the control to test (look in the page's ASP.NET source code for the ID).

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTextAreaTester Constructor Overload List


HtmlTextAreaTester Constructor (String, Tester)

Create a tester for a server-side HTML control or a tag that's on a page with multiple forms. Use this constructor when the HTML tag you are testing has the "runat='server'" attribute. Also use this tester when using the non-default webform or HttpClient.

public HtmlTextAreaTester(
string aspId,
Tester container
);

Parameters

aspId
The ID of the control to test (look in the page's ASP.NET source code for the ID).
container
A tester for the control's container. (In the page's ASP.NET source code, look for the tag that the control is nested in. That's probably the control's container.) If testing a page with multiple forms or a non-default HttpClient, pass in the WebFormTester for the form this tag is within.

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTextAreaTester Constructor Overload List


HtmlTextAreaTester Constructor (String, String)

Create a tester for an HTML tag using an XPath description.

public HtmlTextAreaTester(
string xpath,
string description
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTextAreaTester Constructor Overload List


HtmlTextAreaTester Constructor (String, String, Tester)

Create a tester for an HTML tag that's on a page with multiple forms using an XPath description.

public HtmlTextAreaTester(
string xpath,
string description,
Tester container
);

Parameters

xpath
The XPath description of the tag.
description
A human-readable description of this tag (for error reporting).
container
A tester for the control's container. A WebFormTester will usually be most appropriate.

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace | HtmlTextAreaTester Constructor Overload List


HtmlTextAreaTester Properties

The properties of the HtmlTextAreaTester class are listed below. For a complete list of HtmlTextAreaTester class members, see the HtmlTextAreaTester Members topic.

Public Instance Properties

AspId (inherited from ControlTester) | The ASP.NET ID of the control being tested. It corresponds to the ID in the ASP.NET source code.
BodyNoTags (inherited from HtmlTagTester) | A temporary hack--this method WILL GO AWAY!
Cols | Return the width of the text area in columns, or -1 if undefined (default)
Description (inherited from HtmlTagTester) | A human-readable description of the location of the control.
Disabled (inherited from HtmlControlTester) | Gets or sets a value indicating wheither the control is disabled.
HtmlId (inherited from HtmlTagTester) | The HTML ID of the control being tested. It corresponds to the ID of the HTML tag rendered by the server. It's useful for looking at raw HTML while debugging.
HtmlIdAndDescription (inherited from ControlTester) | A human-readable description of the location of the control being tested. This property describes the location of the control as well as providing the HTML ID of the control, if present.
InnerHtml (inherited from HtmlTagTester) | The raw HTML inside the tag being tested. For example, <a href='foo'><i>My</i> Link</a> will return "<i>My</i> Link".
Name (inherited from HtmlTagTester) | Returns the name of the tag. For example, the tag "<a href='foo'>" will return "a".
Parent (inherited from HtmlTagTester) | Returns the tag that contains this one. Don't cache it. Don't use this on the root element.
RenderedInnerHtml (inherited from HtmlTagTester) | The HTML inside the tag being tested, rendered to a string as a web browser would do. All inner tags are removed and adjacent whitespace is converted to a single space. For example, <a href='foo'><i>My</i> Link</a> will return "My Link".
Rows | Return the height of the text area in rows, or -1 if undefined (default).
Visible (inherited from HtmlTagTester) | Returns true if the tag is visible on the current page.

Protected Instance Properties

IsDisabled (inherited from ControlTester) | True if the control is disabled.
Tag (inherited from HtmlTagTester) | The HTML tag we're testing.

Protected Internal Instance Properties

Browser (inherited from ControlTester) | The browser instance used to load the page containing the form being tested.
Form (inherited from ControlTester) | The form containing this control

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester.Cols Property

Return the width of the text area in columns, or -1 if undefined (default)

public int Cols {get;}

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


HtmlTextAreaTester.Rows Property

Return the height of the text area in rows, or -1 if undefined (default).

public int Rows {get;}

See Also

HtmlTextAreaTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester Class

Tester for System.Web.UI.WebControls.ListItemCollection

For a list of all members of this type, see ListItemCollectionTester Members.

System.Object
ReadOnlyCollectionBase
ListItemCollectionTester

public class ListItemCollectionTester : ReadOnlyCollectionBase

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListItemCollectionTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester Members

ListItemCollectionTester overview

Public Instance Constructors

ListItemCollectionTester Constructor For internal use. May change in future revisions.

Public Instance Properties

Count (inherited from ReadOnlyCollectionBase) |
Item | Gets ListItemTesters contained in this collection by zero-based index.

Public Instance Methods

Contains | Determines whether the collection contains the specified item.
Equals (inherited from Object) |
FindByText | Searches the collection for a ListItemTester whose RenderedText property contains the specified text.
FindByValue | Searches the collection for a ListItemTester with whose Value property contains the specified value.
GetEnumerator (inherited from ReadOnlyCollectionBase) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Object) |

Protected Instance Properties

InnerList (inherited from ReadOnlyCollectionBase)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo (inherited from ReadOnlyCollectionBase)

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester Constructor

For internal use. May change in future revisions.

public ListItemCollectionTester(
HtmlTagTester[] optionList,
HtmlSelectTester container
);

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester Properties

The properties of the ListItemCollectionTester class are listed below. For a complete list of ListItemCollectionTester class members, see the ListItemCollectionTester Members topic.

Public Instance Properties

Count (inherited from ReadOnlyCollectionBase) |
Item | Gets ListItemTesters contained in this collection by zero-based index.

Protected Instance Properties

InnerList (inherited from ReadOnlyCollectionBase)

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester.Item Property

Gets ListItemTesters contained in this collection by zero-based index.

public ListItemTester this[
int index
] {get;}

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester Methods

The methods of the ListItemCollectionTester class are listed below. For a complete list of ListItemCollectionTester class members, see the ListItemCollectionTester Members topic.

Public Instance Methods

Contains | Determines whether the collection contains the specified item.
Equals (inherited from Object) |
FindByText | Searches the collection for a ListItemTester whose RenderedText property contains the specified text.
FindByValue | Searches the collection for a ListItemTester with whose Value property contains the specified value.
GetEnumerator (inherited from ReadOnlyCollectionBase) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo (inherited from ReadOnlyCollectionBase)

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester.Contains Method

Determines whether the collection contains the specified item.

public bool Contains(
ListItemTester item
);

Parameters

item
A System.Web.UI.WebControls.ListItem to search for in the collection.

Return Value

true if the collection contains the specified item; otherwise, false.

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester.FindByText Method

Searches the collection for a ListItemTester whose RenderedText property contains the specified text.

public ListItemTester FindByText(
string text
);

Parameters

text
The text to search for.

Return Value

The first ListItemTester that contains the text specified by the text parameter, or null if none could be found.

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemCollectionTester.FindByValue Method

Searches the collection for a ListItemTester with whose Value property contains the specified value.

public ListItemTester FindByValue(
string value
);

Parameters

value
The value to search for.

Return Value

The first ListItemTester that contains the value specified by the value parameter, or null if none could be found.

See Also

ListItemCollectionTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester Class

Tester for System.Web.UI.WebControls.ListItem

For a list of all members of this type, see ListItemTester Members.

System.Object
ListItemTester

public class ListItemTester

Requirements

Namespace: NUnit.Extensions.Asp.HtmlTester

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ListItemTester Members | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester Members

ListItemTester overview

Public Instance Constructors

ListItemTester Constructor For internal use. May change in future revisions.

Public Instance Properties

RawText | The HTML used to display the text of this item.
RenderedText | Same as RawText, but with HTML tags and adjacent whitespace stripped out.
Selected | Gets a value indicating whether the item is selected.
Text |
Value | Gets the value associated with the ListItemTester.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString | Returns a string that represents the current ListItemTester.

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester Constructor

For internal use. May change in future revisions.

public ListItemTester(
HtmlTagTester option,
HtmlSelectTester container
);

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester Properties

The properties of the ListItemTester class are listed below. For a complete list of ListItemTester class members, see the ListItemTester Members topic.

Public Instance Properties

RawText | The HTML used to display the text of this item.
RenderedText | Same as RawText, but with HTML tags and adjacent whitespace stripped out.
Selected | Gets a value indicating whether the item is selected.
Text |
Value | Gets the value associated with the ListItemTester.

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.RawText Property

The HTML used to display the text of this item.

public string RawText {get;}

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.RenderedText Property

Same as RawText, but with HTML tags and adjacent whitespace stripped out.

public string RenderedText {get;}

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.Selected Property

Gets a value indicating whether the item is selected.

public bool Selected {get; set;}

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.Text Property

public string Text {get;}

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.Value Property

Gets the value associated with the ListItemTester.

public string Value {get;}

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester Methods

The methods of the ListItemTester class are listed below. For a complete list of ListItemTester class members, see the ListItemTester Members topic.

Public Instance Methods

Equals (inherited from Object) |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
ToString | Returns a string that represents the current ListItemTester.

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


ListItemTester.ToString Method

Returns a string that represents the current ListItemTester.

public override string ToString();

Return Value

ListItemTester's Text property.

See Also

ListItemTester Class | NUnit.Extensions.Asp.HtmlTester Namespace


Sgml

NUnitAsp

Sgml Namespace

Classes

Class | Description
AttDef |
AttList |
ContentModel |
ElementDecl |
Entity |
Group |
SgmlDtd |
SgmlReader | SgmlReader is an XmlReader API over any SGML document (including built in support for HTML).

Enumerations

Enumeration | Description
AttributePresence |
AttributeType |
DeclaredContent |
GroupType |
LiteralType |
Occurrence |


AttDef Class

For a list of all members of this type, see AttDef Members.

System.Object
AttDef

public class AttDef

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

AttDef Members | Sgml Namespace


AttDef Members

AttDef overview

Public Instance Constructors

AttDef Constructor

Public Instance Fields

Default
EnumValues
Name
Presence
Type

Public Instance Methods

Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
SetPresence
SetType
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

AttDef Class | Sgml Namespace


AttDef Constructor

public AttDef(
string name
);

See Also

AttDef Class | Sgml Namespace


AttDef Fields

The fields of the AttDef class are listed below. For a complete list of AttDef class members, see the AttDef Members topic.

Public Instance Fields

Default
EnumValues
Name
Presence
Type

See Also

AttDef Class | Sgml Namespace


AttDef.Default Field

public string Default;

See Also

AttDef Class | Sgml Namespace


AttDef.EnumValues Field

public string[] EnumValues;

See Also

AttDef Class | Sgml Namespace


AttDef.Name Field

public string Name;

See Also

AttDef Class | Sgml Namespace


AttDef.Presence Field

public AttributePresence Presence;

See Also

AttDef Class | Sgml Namespace


AttDef.Type Field

public AttributeType Type;

See Also

AttDef Class | Sgml Namespace


AttDef Methods

The methods of the AttDef class are listed below. For a complete list of AttDef class members, see the AttDef Members topic.

Public Instance Methods

Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
SetPresence
SetType
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

AttDef Class | Sgml Namespace


AttDef.SetPresence Method

public bool SetPresence(
string token
);

See Also

AttDef Class | Sgml Namespace


AttDef.SetType Method

public void SetType(
string type
);

See Also

AttDef Class | Sgml Namespace


AttList Class

For a list of all members of this type, see AttList Members.

System.Object
AttList

public class AttList : IEnumerable

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

AttList Members | Sgml Namespace


AttList Members

AttList overview

Public Instance Constructors

AttList Constructor Initializes a new instance of the AttList class.

Public Instance Properties

Item

Public Instance Methods

Add
Equals (inherited from Object)
GetEnumerator
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

AttList Class | Sgml Namespace


AttList Constructor

Initializes a new instance of the AttList class.

public AttList();

See Also

AttList Class | Sgml Namespace


AttList Properties

The properties of the AttList class are listed below. For a complete list of AttList class members, see the AttList Members topic.

Public Instance Properties

Item

See Also

AttList Class | Sgml Namespace


AttList.Item Property

public AttDef this[
string name
] {get;}

See Also

AttList Class | Sgml Namespace


AttList Methods

The methods of the AttList class are listed below. For a complete list of AttList class members, see the AttList Members topic.

Public Instance Methods

Add
Equals (inherited from Object)
GetEnumerator
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

AttList Class | Sgml Namespace


AttList.Add Method

public void Add(
AttDef a
);

See Also

AttList Class | Sgml Namespace


AttList.GetEnumerator Method

public IEnumerator GetEnumerator();

Implements

IEnumerable.GetEnumerator

See Also

AttList Class | Sgml Namespace


AttributePresence Enumeration

public enum AttributePresence

Members

Member Name | Description
DEFAULT |
FIXED |
REQUIRED |
IMPLIED |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


AttributeType Enumeration

public enum AttributeType

Members

Member Name | Description
DEFAULT |
CDATA |
ENTITY |
ENTITIES |
ID |
IDREF |
IDREFS |
NAME |
NAMES |
NMTOKEN |
NMTOKENS |
NUMBER |
NUMBERS |
NUTOKEN |
NUTOKENS |
NOTATION |
ENUMERATION |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


ContentModel Class

For a list of all members of this type, see ContentModel Members.

System.Object
ContentModel

public class ContentModel

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ContentModel Members | Sgml Namespace


ContentModel Members

ContentModel overview

Public Instance Constructors

ContentModel Constructor Initializes a new instance of the ContentModel class.

Public Instance Fields

CurrentDepth
DeclaredContent
Model

Public Instance Methods

AddConnector
AddOccurrence
AddSymbol
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
PopGroup
PushGroup
SetDeclaredContent
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ContentModel Class | Sgml Namespace


ContentModel Constructor

Initializes a new instance of the ContentModel class.

public ContentModel();

See Also

ContentModel Class | Sgml Namespace


ContentModel Fields

The fields of the ContentModel class are listed below. For a complete list of ContentModel class members, see the ContentModel Members topic.

Public Instance Fields

CurrentDepth
DeclaredContent
Model

See Also

ContentModel Class | Sgml Namespace


ContentModel.CurrentDepth Field

public int CurrentDepth;

See Also

ContentModel Class | Sgml Namespace


ContentModel.DeclaredContent Field

public DeclaredContent DeclaredContent;

See Also

ContentModel Class | Sgml Namespace


ContentModel.Model Field

public Group Model;

See Also

ContentModel Class | Sgml Namespace


ContentModel Methods

The methods of the ContentModel class are listed below. For a complete list of ContentModel class members, see the ContentModel Members topic.

Public Instance Methods

AddConnector
AddOccurrence
AddSymbol
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
PopGroup
PushGroup
SetDeclaredContent
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ContentModel Class | Sgml Namespace


ContentModel.AddConnector Method

public void AddConnector(
char c
);

See Also

ContentModel Class | Sgml Namespace


ContentModel.AddOccurrence Method

public void AddOccurrence(
char c
);

See Also

ContentModel Class | Sgml Namespace


ContentModel.AddSymbol Method

public void AddSymbol(
string sym
);

See Also

ContentModel Class | Sgml Namespace


ContentModel.CanContain Method

public bool CanContain(
string name,
SgmlDtd dtd
);

See Also

ContentModel Class | Sgml Namespace


ContentModel.PopGroup Method

public int PopGroup();

See Also

ContentModel Class | Sgml Namespace


ContentModel.PushGroup Method

public void PushGroup();

See Also

ContentModel Class | Sgml Namespace


ContentModel.SetDeclaredContent Method

public void SetDeclaredContent(
string dc
);

See Also

ContentModel Class | Sgml Namespace


DeclaredContent Enumeration

public enum DeclaredContent

Members

Member Name | Description
Default |
CDATA |
RCDATA |
EMPTY |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


ElementDecl Class

For a list of all members of this type, see ElementDecl Members.

System.Object
ElementDecl

public class ElementDecl

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

ElementDecl Members | Sgml Namespace


ElementDecl Members

ElementDecl overview

Public Instance Constructors

ElementDecl Constructor

Public Instance Fields

AttList
ContentModel
EndTagOptional
Exclusions
Inclusions
Name
StartTagOptional

Public Instance Methods

AddAttDefs
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ElementDecl Class | Sgml Namespace


ElementDecl Constructor

public ElementDecl(
string name,
bool sto,
bool eto,
ContentModel cm,
string[] inclusions,
string[] exclusions
);

See Also

ElementDecl Class | Sgml Namespace


ElementDecl Fields

The fields of the ElementDecl class are listed below. For a complete list of ElementDecl class members, see the ElementDecl Members topic.

Public Instance Fields

AttList
ContentModel
EndTagOptional
Exclusions
Inclusions
Name
StartTagOptional

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.AttList Field

public AttList AttList;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.ContentModel Field

public ContentModel ContentModel;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.EndTagOptional Field

public bool EndTagOptional;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.Exclusions Field

public string[] Exclusions;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.Inclusions Field

public string[] Inclusions;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.Name Field

public string Name;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.StartTagOptional Field

public bool StartTagOptional;

See Also

ElementDecl Class | Sgml Namespace


ElementDecl Methods

The methods of the ElementDecl class are listed below. For a complete list of ElementDecl class members, see the ElementDecl Members topic.

Public Instance Methods

AddAttDefs
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.AddAttDefs Method

public void AddAttDefs(
AttList list
);

See Also

ElementDecl Class | Sgml Namespace


ElementDecl.CanContain Method

public bool CanContain(
string name,
SgmlDtd dtd
);

See Also

ElementDecl Class | Sgml Namespace


Entity Class

For a list of all members of this type, see Entity Members.

System.Object
Entity

public class Entity

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Entity Members | Sgml Namespace


Entity Members

Entity overview

Public Static Fields

EOF

Public Static Methods

IsLiteralType

Public Instance Constructors

Entity Overloaded. Initializes a new instance of the Entity class.

Public Instance Fields

Html
Internal
IsWhitespace
Lastchar
Line
Literal
LiteralType
Name
Parent
Proxy
PublicId
Uri

Public Instance Properties

LinePosition
ResolvedUri

Public Instance Methods

Close |
Context |
Equals (inherited from Object) |
Error | Overloaded.
ExpandCharEntity |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Open |
ReadChar |
ScanLiteral |
ScanToEnd |
ScanToken |
SetLiteralType |
SkipWhitespace |
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

Entity Class | Sgml Namespace


Entity Constructor

Overload List

public Entity(string,string);

public Entity(string,string,string,string);

public Entity(string,Uri,TextReader,string);

See Also

Entity Class | Sgml Namespace


Entity Constructor (String, String, String, String)

public Entity(
string name,
string pubid,
string uri,
string proxy
);

See Also

Entity Class | Sgml Namespace | Entity Constructor Overload List


Entity Constructor (String, String)

public Entity(
string name,
string literal
);

See Also

Entity Class | Sgml Namespace | Entity Constructor Overload List


Entity Constructor (String, Uri, TextReader, String)

public Entity(
string name,
Uri baseUri,
TextReader stm,
string proxy
);

See Also

Entity Class | Sgml Namespace | Entity Constructor Overload List


Entity Fields

The fields of the Entity class are listed below. For a complete list of Entity class members, see the Entity Members topic.

Public Static Fields

EOF

Public Instance Fields

Html
Internal
IsWhitespace
Lastchar
Line
Literal
LiteralType
Name
Parent
Proxy
PublicId
Uri

See Also

Entity Class | Sgml Namespace


Entity.EOF Field

public const char EOF;

See Also

Entity Class | Sgml Namespace


Entity.Html Field

public bool Html;

See Also

Entity Class | Sgml Namespace


Entity.Internal Field

public bool Internal;

See Also

Entity Class | Sgml Namespace


Entity.IsWhitespace Field

public bool IsWhitespace;

See Also

Entity Class | Sgml Namespace


Entity.Lastchar Field

public char Lastchar;

See Also

Entity Class | Sgml Namespace


Entity.Line Field

public int Line;

See Also

Entity Class | Sgml Namespace


Entity.Literal Field

public string Literal;

See Also

Entity Class | Sgml Namespace


Entity.LiteralType Field

public LiteralType LiteralType;

See Also

Entity Class | Sgml Namespace


Entity.Name Field

public string Name;

See Also

Entity Class | Sgml Namespace


Entity.Parent Field

public Entity Parent;

See Also

Entity Class | Sgml Namespace


Entity.Proxy Field

public string Proxy;

See Also

Entity Class | Sgml Namespace


Entity.PublicId Field

public string PublicId;

See Also

Entity Class | Sgml Namespace


Entity.Uri Field

public string Uri;

See Also

Entity Class | Sgml Namespace


Entity Properties

The properties of the Entity class are listed below. For a complete list of Entity class members, see the Entity Members topic.

Public Instance Properties

LinePosition
ResolvedUri

See Also

Entity Class | Sgml Namespace


Entity.LinePosition Property

public int LinePosition {get;}

See Also

Entity Class | Sgml Namespace


Entity.ResolvedUri Property

public System.Uri ResolvedUri {get;}

See Also

Entity Class | Sgml Namespace


Entity Methods

The methods of the Entity class are listed below. For a complete list of Entity class members, see the Entity Members topic.

Public Static Methods

IsLiteralType

Public Instance Methods

Close |
Context |
Equals (inherited from Object) |
Error | Overloaded.
ExpandCharEntity |
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
Open |
ReadChar |
ScanLiteral |
ScanToEnd |
ScanToken |
SetLiteralType |
SkipWhitespace |
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

Entity Class | Sgml Namespace


Entity.Close Method

public void Close();

See Also

Entity Class | Sgml Namespace


Entity.Context Method

public string Context();

See Also

Entity Class | Sgml Namespace


Error Method

NUnitAsp

Entity.Error Method

Overload List

public void Error(string);

public void Error(string,char);

public void Error(string,int);

public void Error(string,string);

See Also

Entity Class | Sgml Namespace


Entity.Error Method (String)

public void Error(
string msg
);

See Also

Entity Class | Sgml Namespace | Entity.Error Overload List


Entity.Error Method (String, Char)

public void Error(
string msg,
char ch
);

See Also

Entity Class | Sgml Namespace | Entity.Error Overload List


Entity.Error Method (String, Int32)

public void Error(
string msg,
int x
);

See Also

Entity Class | Sgml Namespace | Entity.Error Overload List


Entity.Error Method (String, String)

public void Error(
string msg,
string arg
);

See Also

Entity Class | Sgml Namespace | Entity.Error Overload List


Entity.ExpandCharEntity Method

public string ExpandCharEntity();

See Also

Entity Class | Sgml Namespace


Entity.IsLiteralType Method

public static bool IsLiteralType(
string token
);

See Also

Entity Class | Sgml Namespace


Entity.Open Method

public void Open(
Entity parent,
Uri baseUri
);

See Also

Entity Class | Sgml Namespace


Entity.ReadChar Method

public char ReadChar();

See Also

Entity Class | Sgml Namespace


Entity.ScanLiteral Method

public string ScanLiteral(
StringBuilder sb,
char quote
);

See Also

Entity Class | Sgml Namespace


Entity.ScanToEnd Method

public string ScanToEnd(
StringBuilder sb,
string type,
string terminators
);

See Also

Entity Class | Sgml Namespace


Entity.ScanToken Method

public string ScanToken(
StringBuilder sb,
string term,
bool nmtoken
);

See Also

Entity Class | Sgml Namespace


Entity.SetLiteralType Method

public void SetLiteralType(
string token
);

See Also

Entity Class | Sgml Namespace


Entity.SkipWhitespace Method

public char SkipWhitespace();

See Also

Entity Class | Sgml Namespace


Group Class

For a list of all members of this type, see Group Members.

System.Object
Group

public class Group

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Group Members | Sgml Namespace


Group Members

Group overview

Public Instance Constructors

Group Constructor

Public Instance Fields

GroupType
Members
Mixed
Occurrence
Parent

Public Instance Methods

AddConnector
AddGroup
AddOccurrence
AddSymbol
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

Group Class | Sgml Namespace


Group Constructor

public Group(
Group parent
);

See Also

Group Class | Sgml Namespace


Group Fields

The fields of the Group class are listed below. For a complete list of Group class members, see the Group Members topic.

Public Instance Fields

GroupType
Members
Mixed
Occurrence
Parent

See Also

Group Class | Sgml Namespace


Group.GroupType Field

public GroupType GroupType;

See Also

Group Class | Sgml Namespace


Group.Members Field

public ArrayList Members;

See Also

Group Class | Sgml Namespace


Group.Mixed Field

public bool Mixed;

See Also

Group Class | Sgml Namespace


Group.Occurrence Field

public Occurrence Occurrence;

See Also

Group Class | Sgml Namespace


Group.Parent Field

public Group Parent;

See Also

Group Class | Sgml Namespace


Group Methods

The methods of the Group class are listed below. For a complete list of Group class members, see the Group Members topic.

Public Instance Methods

AddConnector
AddGroup
AddOccurrence
AddSymbol
CanContain
Equals (inherited from Object)
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

Group Class | Sgml Namespace


Group.AddConnector Method

public void AddConnector(
char c
);

See Also

Group Class | Sgml Namespace


Group.AddGroup Method

public void AddGroup(
Group g
);

See Also

Group Class | Sgml Namespace


Group.AddOccurrence Method

public void AddOccurrence(
char c
);

See Also

Group Class | Sgml Namespace


Group.AddSymbol Method

public void AddSymbol(
string sym
);

See Also

Group Class | Sgml Namespace


Group.CanContain Method

public bool CanContain(
string name,
SgmlDtd dtd
);

See Also

Group Class | Sgml Namespace


GroupType Enumeration

public enum GroupType

Members

Member Name | Description
None |
And |
Or |
Sequence |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


LiteralType Enumeration

public enum LiteralType

Members

Member Name | Description
CDATA |
SDATA |
PI |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


Occurrence Enumeration

public enum Occurrence

Members

Member Name | Description
Required |
Optional |
ZeroOrMore |
OneOrMore |

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

Sgml Namespace


SgmlDtd Class

For a list of all members of this type, see SgmlDtd Members.

System.Object
SgmlDtd

public class SgmlDtd

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

SgmlDtd Members | Sgml Namespace


SgmlDtd Members

SgmlDtd overview

Public Static Methods

Parse Overloaded.

Public Instance Constructors

SgmlDtd Constructor

Public Instance Fields

Name

Public Instance Properties

NameTable

Public Instance Methods

Equals (inherited from Object)
FindElement
FindEntity
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd Constructor

public SgmlDtd(
string name,
XmlNameTable nt
);

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd Fields

The fields of the SgmlDtd class are listed below. For a complete list of SgmlDtd class members, see the SgmlDtd Members topic.

Public Instance Fields

Name

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd.Name Field

public string Name;

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd Properties

The properties of the SgmlDtd class are listed below. For a complete list of SgmlDtd class members, see the SgmlDtd Members topic.

Public Instance Properties

NameTable

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd.NameTable Property

public System.Xml.XmlNameTable NameTable {get;}

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd Methods

The methods of the SgmlDtd class are listed below. For a complete list of SgmlDtd class members, see the SgmlDtd Members topic.

Public Static Methods

Parse Overloaded.

Public Instance Methods

Equals (inherited from Object)
FindElement
FindEntity
GetHashCode (inherited from Object)
GetType (inherited from Object)
ToString (inherited from Object)

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd.FindElement Method

public ElementDecl FindElement(
string name
);

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd.FindEntity Method

public Entity FindEntity(
string name
);

See Also

SgmlDtd Class | Sgml Namespace


Parse Method

NUnitAsp

SgmlDtd.Parse Method

Overload List

public static SgmlDtd Parse(Uri,string,string,TextReader,string,string,XmlNameTable);

public static SgmlDtd Parse(Uri,string,string,string,string,string,XmlNameTable);

See Also

SgmlDtd Class | Sgml Namespace


SgmlDtd.Parse Method (Uri, String, String, TextReader, String, String, XmlNameTable)

public static SgmlDtd Parse(
Uri baseUri,
string name,
string pubid,
TextReader input,
string subset,
string proxy,
XmlNameTable nt
);

See Also

SgmlDtd Class | Sgml Namespace | SgmlDtd.Parse Overload List


SgmlDtd.Parse Method (Uri, String, String, String, String, String, XmlNameTable)

public static SgmlDtd Parse(
Uri baseUri,
string name,
string pubid,
string url,
string subset,
string proxy,
XmlNameTable nt
);

See Also

SgmlDtd Class | Sgml Namespace | SgmlDtd.Parse Overload List


SgmlReader Class

SgmlReader is an XmlReader API over any SGML document (including built in support for HTML).

For a list of all members of this type, see SgmlReader Members.

System.Object
XmlReader
SgmlReader

public class SgmlReader : XmlReader

Requirements

Namespace: Sgml

Assembly: NUnitAsp (in NUnitAsp.dll)

See Also

SgmlReader Members | Sgml Namespace


SgmlReader Members

SgmlReader overview

Public Instance Constructors

SgmlReader Constructor Initializes a new instance of the SgmlReader class.

Public Instance Properties

AttributeCount |
BaseURI |
CanResolveEntity (inherited from XmlReader) |
Depth |
DocType | The name of root element specified in the DOCTYPE tag.
Dtd | Specify the SgmlDtd object directly. This allows you to cache the Dtd and share it across multipl SgmlReaders. To load a DTD from a URL use the SystemLiteral property.
EOF |
ErrorLog | DTD validation errors are written to this stream.
ErrorLogFile | DTD validation errors are written to this log file.
HasAttributes (inherited from XmlReader) |
HasValue |
Href | Specify the location of the input SGML document as a URL.
InputStream | The input stream containing SGML data to parse. You must specify this property or the Href property before calling Read().
InternalSubset | The DTD internal subset in the DOCTYPE tag
IsDefault |
IsEmptyElement |
Item | Overloaded.
LocalName |
Name |
NamespaceURI |
NameTable |
NodeType |
Prefix |
PublicIdentifier | The PUBLIC identifier in the DOCTYPE tag
QuoteChar |
ReadState |
SystemLiteral | The SYSTEM literal in the DOCTYPE tag identifying the location of the DTD.
Value |
WebProxy | Sometimes you need to specify a proxy server in order to load data via HTTP from outside the firewall. For example: "itgproxy:80".
WhitespaceHandling |
XmlLang |
XmlSpace |

Public Instance Methods

Close |
Equals (inherited from Object) |
GetAttribute | Overloaded.
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
IsStartElement (inherited from XmlReader) | Overloaded.
LookupNamespace |
MoveToAttribute | Overloaded.
MoveToContent (inherited from XmlReader) |
MoveToElement |
MoveToFirstAttribute |
MoveToNextAttribute |
Read |
ReadAttributeValue |
ReadElementString (inherited from XmlReader) | Overloaded.
ReadEndElement (inherited from XmlReader) |
ReadInnerXml |
ReadOuterXml |
ReadStartElement (inherited from XmlReader) | Overloaded.
ReadString |
ResolveEntity |
ScanLiteral |
SetBaseUri | The base Uri is used to resolve relative Uri's like the SystemLiteral and Href properties. This is a method because BaseURI is a read-only property on the base XmlReader class.
Skip (inherited from XmlReader) |
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

SgmlReader Class | Sgml Namespace


SgmlReader Constructor

Initializes a new instance of the SgmlReader class.

public SgmlReader();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader Properties

The properties of the SgmlReader class are listed below. For a complete list of SgmlReader class members, see the SgmlReader Members topic.

Public Instance Properties

AttributeCount |
BaseURI |
CanResolveEntity (inherited from XmlReader) |
Depth |
DocType | The name of root element specified in the DOCTYPE tag.
Dtd | Specify the SgmlDtd object directly. This allows you to cache the Dtd and share it across multipl SgmlReaders. To load a DTD from a URL use the SystemLiteral property.
EOF |
ErrorLog | DTD validation errors are written to this stream.
ErrorLogFile | DTD validation errors are written to this log file.
HasAttributes (inherited from XmlReader) |
HasValue |
Href | Specify the location of the input SGML document as a URL.
InputStream | The input stream containing SGML data to parse. You must specify this property or the Href property before calling Read().
InternalSubset | The DTD internal subset in the DOCTYPE tag
IsDefault |
IsEmptyElement |
Item | Overloaded.
LocalName |
Name |
NamespaceURI |
NameTable |
NodeType |
Prefix |
PublicIdentifier | The PUBLIC identifier in the DOCTYPE tag
QuoteChar |
ReadState |
SystemLiteral | The SYSTEM literal in the DOCTYPE tag identifying the location of the DTD.
Value |
WebProxy | Sometimes you need to specify a proxy server in order to load data via HTTP from outside the firewall. For example: "itgproxy:80".
WhitespaceHandling |
XmlLang |
XmlSpace |

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.AttributeCount Property

public override int AttributeCount {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.BaseURI Property

public override string BaseURI {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Depth Property

public override int Depth {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.DocType Property

The name of root element specified in the DOCTYPE tag.

public string DocType {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Dtd Property

Specify the SgmlDtd object directly. This allows you to cache the Dtd and share it across multipl SgmlReaders. To load a DTD from a URL use the SystemLiteral property.

public SgmlDtd Dtd {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.EOF Property

public override bool EOF {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ErrorLog Property

DTD validation errors are written to this stream.

public System.IO.TextWriter ErrorLog {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ErrorLogFile Property

DTD validation errors are written to this log file.

public string ErrorLogFile {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.HasValue Property

public override bool HasValue {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Href Property

Specify the location of the input SGML document as a URL.

public string Href {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.InputStream Property

The input stream containing SGML data to parse. You must specify this property or the Href property before calling Read().

public System.IO.TextReader InputStream {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.InternalSubset Property

The DTD internal subset in the DOCTYPE tag

public string InternalSubset {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.IsDefault Property

public override bool IsDefault {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.IsEmptyElement Property

public override bool IsEmptyElement {get;}

See Also

SgmlReader Class | Sgml Namespace


Item Property

NUnitAsp

SgmlReader.Item Property

Overload List

public override string this[int] {get;}

public override string this[string] {get;}

public override string this[string, string] {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Item Property

public override string this[
int i
] {get;}

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.Item Overload List


SgmlReader.Item Property

public override string this[
string name
] {get;}

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.Item Overload List


SgmlReader.Item Property

public override string this[
string name,
string namespaceURI
] {get;}

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.Item Overload List


SgmlReader.LocalName Property

public override string LocalName {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Name Property

public override string Name {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.NamespaceURI Property

public override string NamespaceURI {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.NameTable Property

public override System.Xml.XmlNameTable NameTable {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.NodeType Property

public override System.Xml.XmlNodeType NodeType {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Prefix Property

public override string Prefix {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.PublicIdentifier Property

The PUBLIC identifier in the DOCTYPE tag

public string PublicIdentifier {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.QuoteChar Property

public override char QuoteChar {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ReadState Property

public override System.Xml.ReadState ReadState {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.SystemLiteral Property

The SYSTEM literal in the DOCTYPE tag identifying the location of the DTD.

public string SystemLiteral {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Value Property

public override string Value {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.WebProxy Property

Sometimes you need to specify a proxy server in order to load data via HTTP from outside the firewall. For example: "itgproxy:80".

public string WebProxy {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.WhitespaceHandling Property

public System.Xml.WhitespaceHandling WhitespaceHandling {get; set;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.XmlLang Property

public override string XmlLang {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.XmlSpace Property

public override System.Xml.XmlSpace XmlSpace {get;}

See Also

SgmlReader Class | Sgml Namespace


SgmlReader Methods

The methods of the SgmlReader class are listed below. For a complete list of SgmlReader class members, see the SgmlReader Members topic.

Public Instance Methods

Close |
Equals (inherited from Object) |
GetAttribute | Overloaded.
GetHashCode (inherited from Object) |
GetType (inherited from Object) |
IsStartElement (inherited from XmlReader) | Overloaded.
LookupNamespace |
MoveToAttribute | Overloaded.
MoveToContent (inherited from XmlReader) |
MoveToElement |
MoveToFirstAttribute |
MoveToNextAttribute |
Read |
ReadAttributeValue |
ReadElementString (inherited from XmlReader) | Overloaded.
ReadEndElement (inherited from XmlReader) |
ReadInnerXml |
ReadOuterXml |
ReadStartElement (inherited from XmlReader) | Overloaded.
ReadString |
ResolveEntity |
ScanLiteral |
SetBaseUri | The base Uri is used to resolve relative Uri's like the SystemLiteral and Href properties. This is a method because BaseURI is a read-only property on the base XmlReader class.
Skip (inherited from XmlReader) |
ToString (inherited from Object) |

Protected Instance Methods

Finalize (inherited from Object)
MemberwiseClone (inherited from Object)

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Close Method

public override void Close();

See Also

SgmlReader Class | Sgml Namespace


GetAttribute Method

NUnitAsp

SgmlReader.GetAttribute Method

Overload List

public override string GetAttribute(int);

public override string GetAttribute(string);

public override string GetAttribute(string,string);

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.GetAttribute Method (Int32)

public override string GetAttribute(
int i
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.GetAttribute Overload List


SgmlReader.GetAttribute Method (String)

public override string GetAttribute(
string name
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.GetAttribute Overload List


SgmlReader.GetAttribute Method (String, String)

public override string GetAttribute(
string name,
string namespaceURI
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.GetAttribute Overload List


SgmlReader.LookupNamespace Method

public override string LookupNamespace(
string prefix
);

See Also

SgmlReader Class | Sgml Namespace


MoveToAttribute Method

NUnitAsp

SgmlReader.MoveToAttribute Method

Overload List

public override void MoveToAttribute(int);

public override bool MoveToAttribute(string);

public override bool MoveToAttribute(string,string);

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.MoveToAttribute Method (Int32)

public override void MoveToAttribute(
int i
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.MoveToAttribute Overload List


SgmlReader.MoveToAttribute Method (String)

public override bool MoveToAttribute(
string name
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.MoveToAttribute Overload List


SgmlReader.MoveToAttribute Method (String, String)

public override bool MoveToAttribute(
string name,
string ns
);

See Also

SgmlReader Class | Sgml Namespace | SgmlReader.MoveToAttribute Overload List


SgmlReader.MoveToElement Method

public override bool MoveToElement();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.MoveToFirstAttribute Method

public override bool MoveToFirstAttribute();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.MoveToNextAttribute Method

public override bool MoveToNextAttribute();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.Read Method

public override bool Read();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ReadAttributeValue Method

public override bool ReadAttributeValue();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ReadInnerXml Method

public override string ReadInnerXml();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ReadOuterXml Method

public override string ReadOuterXml();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ReadString Method

public override string ReadString();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ResolveEntity Method

public override void ResolveEntity();

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.ScanLiteral Method

public string ScanLiteral(
StringBuilder sb,
char quote
);

See Also

SgmlReader Class | Sgml Namespace


SgmlReader.SetBaseUri Method

The base Uri is used to resolve relative Uri's like the SystemLiteral and Href properties. This is a method because BaseURI is a read-only property on the base XmlReader class.

public void SetBaseUri(
string uri
);

See Also

SgmlReader Class | Sgml Namespace