Udostępnij za pośrednictwem


WebTestRequest.ExpectedHttpStatusCode Property

Gets or sets the HTTP status code that is expected for this request.

Namespace:  Microsoft.VisualStudio.TestTools.WebTesting
Assembly:  Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)

Syntax

'Declaration
Public Property ExpectedHttpStatusCode As Integer
'Usage
Dim instance As WebTestRequest 
Dim value As Integer 

value = instance.ExpectedHttpStatusCode

instance.ExpectedHttpStatusCode = value
public int ExpectedHttpStatusCode { get; set; }
public:
property int ExpectedHttpStatusCode {
    int get ();
    void set (int value);
}
public function get ExpectedHttpStatusCode () : int 
public function set ExpectedHttpStatusCode (value : int)

Property Value

Type: System.Int32

Remarks

You can use this property in code to prevent a request from failing when you expect a failure status for a request, such as a "404 Not Found" status.

.NET Framework Security

See Also

Reference

WebTestRequest Class

WebTestRequest Members

Microsoft.VisualStudio.TestTools.WebTesting Namespace