PrivateObject.SetFieldOrProperty Method (String, Object)
Sets a value of a wrapped field or property based on the name.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Syntax
'Declaration
Public Sub SetFieldOrProperty ( _
name As String, _
value As Object _
)
public void SetFieldOrProperty(
string name,
Object value
)
public:
void SetFieldOrProperty(
String^ name,
Object^ value
)
member SetFieldOrProperty :
name:string *
value:Object -> unit
public function SetFieldOrProperty(
name : String,
value : Object
)
Parameters
name
Type: StringThe name of the private field or property to set.
value
Type: ObjectThe value to set for name.
Remarks
Important
This is important for Visual Basic source code as fields and properties are used the same way.
.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.