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: StringThe key to an object.
value
Type: ObjectA 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.