我有两个类,但我想从 LastFridayDate 类到 Buildversion 类的值字符串“版本”。
大家好,我有两个类,但我想从 LastFridayDate 类到 Buildversion 类的值字符串“版本”。
我无法访问字符串版本,有人提供任何帮助。
我的代码:
using System;
using Microsoft.VisualStudio.TestTools.WebTesting;
using Microsoft.VisualStudio.TestTools.LoadTesting;
using System.ComponentModel;
namespace PTUtil
{
[System.ComponentModel.DisplayName("GetVersion")]
[System.ComponentModel.Description("Get the Build No Version")]
public class LastFridayDate : WebTestPlugin
{
String version;
//Setting the version in the usercontext
public override void PostWebTest(object sender, PostWebTestEventArgs e)
{
version = e.WebTest.Context["Param_ClientSoftwareVersion"].ToString();
}
}
/// Specify a name for use in the user interface.
/// The user sees this name in the Add Validation dialog box.
[DisplayName("Build Version Processing")]
/// Specify a description for use in the user interface
/// The user sees this description in the Add Validation dialog box.
[Description("Add the build version for a load test")]
public class BuildVersion : ILoadTestPlugin
{
[DisplayName("Comment")]
[Description("What the plugin is for")]
public string theComment { get; set; }
[DisplayName("Test Type")]
[Description("M for Manual or A for Automatic")]
[DefaultValue("A")]
public string connectionStr { get; set; }
[DisplayName("Version Context Parameter")]
[Description("The Context Parameter for the build version")]
[DefaultValue("{{Param_ClientSoftwareVersion}}")]
public string Version_param { get; set; }
LoadTest m_loadTest;
public void Initialize(LoadTest loadTest)
{
m_loadTest = loadTest;
m_loadTest.LoadTestFinished += new EventHandler(m_loadTest_LoadTestFinished);
}
// Do it *after* the Load Test.
//---------------------------------------------------------------------
void m_loadTest_LoadTestFinished(object sender, System.EventArgs e)
{
}
}
}