Commit 5425e667 5425e667d0ec84526911ebd440116c56a3d151ce by Christian Gerdes

Added sanity checks to ThinTimeEmulator10190

1 parent 104e7ce7
...@@ -141,7 +141,7 @@ namespace LIL_VSTT_Plugins ...@@ -141,7 +141,7 @@ namespace LIL_VSTT_Plugins
141 [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.")] 141 [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.")]
142 public class ThinkTimeEmulator10190 : ILoadTestPlugin 142 public class ThinkTimeEmulator10190 : ILoadTestPlugin
143 { 143 {
144 [DisplayName("ThinkTime"), DefaultValue(0), Description("The Think Time to be used seconds. Default is 0.")] 144 [DisplayName("ThinkTime"), DefaultValue(35), Description("The Think Time to be used seconds. Default is 35.")]
145 public int ThinkTime { get; set; } 145 public int ThinkTime { get; set; }
146 [DisplayName("Minimum"), DefaultValue(10), Description("Percentage of ThinkTime to be used as the minimum value")] 146 [DisplayName("Minimum"), DefaultValue(10), Description("Percentage of ThinkTime to be used as the minimum value")]
147 public int Min { get; set; } 147 public int Min { get; set; }
...@@ -166,6 +166,12 @@ namespace LIL_VSTT_Plugins ...@@ -166,6 +166,12 @@ namespace LIL_VSTT_Plugins
166 if (!String.IsNullOrEmpty(RegExScenarioName)) 166 if (!String.IsNullOrEmpty(RegExScenarioName))
167 rxScenarioName = new Regex(RegExScenarioName); 167 rxScenarioName = new Regex(RegExScenarioName);
168 168
169 // Sanity checks
170 if (ThinkTime == 0) ThinkTime = 35;
171 if (Min > Max) { Min = 100; Max = 100; }
172 if (Min == 0) Min = 10;
173 if (Max == 0) Max = 190;
174
169 //connect to the TestStarting event. 175 //connect to the TestStarting event.
170 mLoadTest.TestStarting += new EventHandler<TestStartingEventArgs>(mLoadTest_TestStarting); 176 mLoadTest.TestStarting += new EventHandler<TestStartingEventArgs>(mLoadTest_TestStarting);
171 } 177 }
......