Exemple #1
0
            /// <summary>
            ///     Executes the action
            /// </summary>
            /// <param name="e"></param>
            protected override void OnClick(EventArgs e)
            {
                Step newStep = (Step)acceptor.getFactory().createStep();

                newStep.Enclosing = TimeLineControl.TestCase;

                SubStep subStep = (SubStep)acceptor.getFactory().createSubStep();

                subStep.Name = "Substep 1";
                newStep.appendSubSteps(subStep);

                TestCase testCase = GetTestCase();

                if (Step != null)
                {
                    newStep.Name = "NewStep";
                    int index = TimeLineControl.Steps.IndexOf(Step);
                    testCase.Steps.Insert(index + 1, newStep);
                    newStep.setFather(testCase);
                }
                else
                {
                    newStep.Name = "Step " + (TimeLineControl.Steps.Count + 1);
                    testCase.Steps.Add(newStep);
                    newStep.setFather(testCase);
                }

                base.OnClick(e);
            }
        /// <summary>
        ///     Creates a step in a test case
        /// </summary>
        /// <param name="enclosing"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        protected SubStep CreateSubStep(Step enclosing, string name)
        {
            SubStep retVal = (SubStep)Factory.createSubStep();

            enclosing.appendSubSteps(retVal);
            retVal.Name = name;

            return(retVal);
        }
        /// <summary>
        ///     Creates a step in a test case
        /// </summary>
        /// <param name="enclosing"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        protected SubStep CreateSubStep(Step enclosing, string name)
        {
            SubStep retVal = (SubStep) Factory.createSubStep();
            enclosing.appendSubSteps(retVal);
            retVal.Name = name;

            return retVal;
        }