Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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]));
        }