C# Класс NUnit.Extensions.Asp.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.

Наследование: Tester
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
IsPostBack ( string candidatePostBackScript ) : bool

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

OptionalPostBack ( string candidatePostBackScript ) : void

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

PostBack ( string postBackScript ) : void

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(string, string) 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.

PostBack ( string eventTarget, string eventArgument ) : void

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(string).

Submit ( ) : void

Submit this form to the server.

WebFormTester ( HttpClient browser ) : System

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

WebFormTester ( string aspId, HttpClient browser ) : System

Защищенные методы

Метод Описание
GetChildElementHtmlId ( string aspId ) : string

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.

Приватные методы

Метод Описание
FindTagByForm ( ) : HtmlTagTester
FindTagById ( ) : HtmlTagTester
TryPostBack ( string postBackScript, string postBackPattern ) : bool

Описание методов

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.
protected GetChildElementHtmlId ( string aspId ) : string
aspId string
Результат string

IsPostBack() публичный Метод

Checks a string to see if it contains a post-back script. Typically you should just use OptionalPostBack instead.
public IsPostBack ( string candidatePostBackScript ) : bool
candidatePostBackScript string
Результат bool

OptionalPostBack() публичный Метод

Like PostBack, except that it does nothing if candidatePostBackScript doesn't contain a post-back script.
public OptionalPostBack ( string candidatePostBackScript ) : void
candidatePostBackScript string
Результат void

PostBack() публичный Метод

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(string, string) 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 PostBack ( string postBackScript ) : void
postBackScript string
Результат void

PostBack() публичный Метод

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(string).
public PostBack ( string eventTarget, string eventArgument ) : void
eventTarget string The "event target" parameter for the post-back script.
eventArgument string The "event argument" parameter for the post-back script.
Результат void

Submit() публичный Метод

Submit this form to the server.
public Submit ( ) : void
Результат void

WebFormTester() публичный Метод

Create the tester and link it to an ASP.NET web form.
public WebFormTester ( HttpClient browser ) : System
browser HttpClient The browser used to load this page.
Результат System

WebFormTester() публичный Метод

public WebFormTester ( string aspId, HttpClient browser ) : System
aspId string
browser HttpClient
Результат System