다음을 통해 공유


WebTestContext.Add Method (String, Object)

Adds an element with the provided key and value to the WebTestContext.

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

Syntax

'Declaration
Public Sub Add ( _
    key As String, _
    value As Object _
)
public void Add(
    string key,
    Object value
)
public:
virtual void Add(
    String^ key, 
    Object^ value
) sealed
abstract Add : 
        key:string * 
        value:Object -> unit  
override Add : 
        key:string * 
        value:Object -> unit
public final function Add(
    key : String, 
    value : Object
)

Parameters

  • key
    Type: String

    The key to an object.

  • value
    Type: Object

    A value that corresponds to the key.

Implements

IDictionary.Add(UTP, UTP)

Exceptions

Exception Condition
ArgumentNullException

key is nulla null reference (Nothing in Visual Basic).

ArgumentException

An element with the same key already occurs in the collection.

.NET Framework Security

See Also

Reference

WebTestContext Class

Add Overload

Microsoft.VisualStudio.TestTools.WebTesting Namespace