Condividi tramite


PrivateType.SetStaticField Method (String, BindingFlags, Object)

Sets a static field contained in the wrapped type.

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

Syntax

'Declaration
Public Sub SetStaticField ( _
    name As String, _
    bindingFlags As BindingFlags, _
    value As Object _
)
public void SetStaticField(
    string name,
    BindingFlags bindingFlags,
    Object value
)
public:
void SetStaticField(
    String^ name, 
    BindingFlags bindingFlags, 
    Object^ value
)
member SetStaticField : 
        name:string * 
        bindingFlags:BindingFlags * 
        value:Object -> unit
public function SetStaticField(
    name : String, 
    bindingFlags : BindingFlags, 
    value : Object
)

Parameters

  • name
    Type: String

    The name of the static field.

  • bindingFlags
    Type: BindingFlags
  • value
    Type: Object

    The value to set to the static field.

.NET Framework Security

See Also

Reference

PrivateType Class

SetStaticField Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace