다음을 통해 공유


TestContext.RequestedPage Property

Gets the requested page.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property RequestedPage As Page
public virtual Page RequestedPage { get; }
public:
virtual property Page^ RequestedPage {
    Page^ get ();
}
abstract RequestedPage : Page with get 
override RequestedPage : Page with get
function get RequestedPage () : Page

Property Value

Type: Page
A Page object.

Exceptions

Exception Condition
InvalidCastException

An invalid value type is associated with the RequestedPage property of the test context.

Remarks

This property is only valid when you run ASP.NET unit tests. This property references the Page object created by the URL used to invoke the test.

.NET Framework Security

See Also

Reference

TestContext Class

Microsoft.VisualStudio.TestTools.UnitTesting Namespace

Other Resources

Using the TestContext Class