NUnitAsp

DataGridTester Members

DataGridTester overview

Public Instance Constructors

DataGridTesterOverloaded. 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