public OrStepInstance(ProfileInstance profileInstance, StepInstance parentStepInstance, OrStep step) : base(profileInstance, parentStepInstance, step) { const string method = ".ctor"; var currentPercentage = 0; var enabledSteps = 0; foreach (var childStep in step) { currentPercentage += childStep.Percentage * 100; if (childStep.Enabled) { ++enabledSteps; } _percentages.Add(currentPercentage); } // Check the percentages. if (currentPercentage != 10000) { throw new InvalidConfigurationValueException(GetType(), method, "percentage", currentPercentage / 100); } if (enabledSteps == 0) { throw new InvalidConfigurationValueException(GetType(), method, "enabled", false); } }
protected StepInstance(ProfileInstance profileInstance, StepInstance parentStepInstance, Step step) { _profileInstance = profileInstance; _parentStepInstance = parentStepInstance; _enabled = step.Enabled; _iterations = step.Iterations.Next; }
public ComponentStepInstance(ProfileInstance profileInstance, StepInstance parentStepInstance, ComponentStep step, MethodInfo beginMethodInfo, MethodInfo endMethodInfo, StepCounters counters) : base(profileInstance, parentStepInstance, step) { _name = step.Name; _beginMethodInfo = beginMethodInfo; _endMethodInfo = endMethodInfo; _delay = step.Delay; _counters = counters; }
private void Process(StepInstance stepInstance) { const string method = "Process"; if (EventSource.IsEnabled(Event.MethodEnter)) { EventSource.Raise(Event.MethodEnter, method); } // Process the next step. Interlocked.Increment(ref _outstandingRequests); _stepRunner.BeginProcessRequest(stepInstance, ProcessCallback, stepInstance.ProfileInstance); if (EventSource.IsEnabled(Event.MethodExit)) { EventSource.Raise(Event.MethodExit, method); } }
private StepInstance CreateStepInstance(ProfileCounters counters, StepInstance parentStepInstance, ComponentStep step) { // Look for the method. MethodInfo endMethod = null; var beginMethod = _testFixture.GetType().GetMethod(step.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding); if (beginMethod == null) { // Look for a Begin-End pair. beginMethod = _testFixture.GetType().GetMethod("Begin" + step.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding); if (beginMethod == null) { throw new ApplicationException("Method '" + step.Name + "' not found on profile '" + _testFixture.GetType().FullName + "."); } endMethod = _testFixture.GetType().GetMethod("End" + step.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding); } return(new ComponentStepInstance(this, parentStepInstance, step, beginMethod, endMethod, counters.StepCounters[step.Name])); }
public void Add(StepInstance stepInstance) { _stepInstances.Add(stepInstance); }
protected StepInstanceList(ProfileInstance profileInstance, StepInstance parentStepInstance, Step step) : base(profileInstance, parentStepInstance, step) { }
public AndStepInstance(ProfileInstance profileInstance, StepInstance parentStepInstance, AndStep step) : base(profileInstance, parentStepInstance, step) { }
private StepInstance CreateStepInstance(Profile profile, ProfileCounters counters, StepInstance parentStepInstance, AndStep step) { var stepInstance = new AndStepInstance(this, parentStepInstance, step); CreateChildStepInstances(stepInstance, step, profile, counters); return(stepInstance); }
private StepInstance CreateStepInstance(Profile profile, ProfileCounters counters, StepInstance parentStepInstance, Step step) { if (step is ComponentStep) { return(CreateStepInstance(counters, parentStepInstance, (ComponentStep)step)); } if (step is OrStep) { return(CreateStepInstance(profile, counters, parentStepInstance, (OrStep)step)); } if (step is AndStep) { return(CreateStepInstance(profile, counters, parentStepInstance, (AndStep)step)); } return(null); }