Commit 5425e667 5425e667d0ec84526911ebd440116c56a3d151ce by Christian Gerdes

Added sanity checks to ThinTimeEmulator10190

1 parent 104e7ce7
......@@ -141,7 +141,7 @@ namespace LIL_VSTT_Plugins
[DisplayName("Think Time Emulator 10/190"), Description("Sets a context parameter named ThinkTime in each starting test to a random value between 10%-190% of the specified value.")]
public class ThinkTimeEmulator10190 : ILoadTestPlugin
{
[DisplayName("ThinkTime"), DefaultValue(0), Description("The Think Time to be used seconds. Default is 0.")]
[DisplayName("ThinkTime"), DefaultValue(35), Description("The Think Time to be used seconds. Default is 35.")]
public int ThinkTime { get; set; }
[DisplayName("Minimum"), DefaultValue(10), Description("Percentage of ThinkTime to be used as the minimum value")]
public int Min { get; set; }
......@@ -166,6 +166,12 @@ namespace LIL_VSTT_Plugins
if (!String.IsNullOrEmpty(RegExScenarioName))
rxScenarioName = new Regex(RegExScenarioName);
// Sanity checks
if (ThinkTime == 0) ThinkTime = 35;
if (Min > Max) { Min = 100; Max = 100; }
if (Min == 0) Min = 10;
if (Max == 0) Max = 190;
//connect to the TestStarting event.
mLoadTest.TestStarting += new EventHandler<TestStartingEventArgs>(mLoadTest_TestStarting);
}
......