共用方式為


TestStartingEventArgs.TestContextProperties 屬性

取得包含資料的 IDictionary,這些資料可以由載入測試中的個別測試加以使用。

命名空間:  Microsoft.VisualStudio.TestTools.LoadTesting
組件:  Microsoft.VisualStudio.QualityTools.LoadTestFramework (在 Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll 中)

語法

'宣告
Public ReadOnly Property TestContextProperties As IDictionary(Of String, Object)
public IDictionary<string, Object> TestContextProperties { get; }
public:
property IDictionary<String^, Object^>^ TestContextProperties {
    IDictionary<String^, Object^>^ get ();
}
member TestContextProperties : IDictionary<string, Object> with get
function get TestContextProperties () : IDictionary<String, Object>

屬性值

類型:IDictionary<String, Object>
IDictionary

備註

載入測試外掛程式實作會使用 TestContextProperties,將資料傳遞給這個載入測試所包含的個別測試。 這些屬性可以透過單元測試中的 TestContext 物件和 Web 測試中的 WebTestContext 加以使用。

TestStarting 事件發生時,TestContextProperties 便為空的。 當您將資料加入至 IDictionary 物件 (由 TestStarting 事件之事件處理常式中的 TestContextProperties 所提供) 之後,這個載入測試引擎便會將 TestContextProperties 的內容加入至測試內容中。

.NET Framework 安全性

請參閱

參考

TestStartingEventArgs 類別

Microsoft.VisualStudio.TestTools.LoadTesting 命名空間

其他資源

如何:建立負載測試外掛程式

About Data Binding