public override void visit(Generated.SubSequence obj, bool visitSubNodes)
        {
            Tests.SubSequence subSequence = (Tests.SubSequence)obj;

            if (subSequence != null)
            {
                if (subSequence.TestCases.Count == 0)
                {
                    subSequence.AddWarning("Sub sequences should hold at least one test case");
                }
                else
                {
                    Tests.TestCase testCase = (Tests.TestCase)subSequence.TestCases[0];

                    if (testCase.Steps.Count == 0)
                    {
                        testCase.AddWarning("First test case of a subsequence should hold at least one step");
                    }
                    else
                    {
                        Tests.Step step = (Tests.Step)testCase.Steps[0];

                        if (step.Name.IndexOf("Setup") < 0 && step.Name.IndexOf("Initialize") < 0)
                        {
                            step.AddWarning("First step of the first test case of a subsequence should be used to setup the system, and should hold 'Setup' or 'Initialize' in its name");
                        }
                    }
                }
            }

            base.visit(obj, visitSubNodes);
        }
Exemplo n.º 2
0
        public override SubSequence createSubSequence()
        {
            SubSequence retVal = new Tests.SubSequence();

            _defaultValueSetter.SetDefaultValue(retVal);

            return(retVal);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds a model element in this model element
 /// </summary>
 /// <param name="copy"></param>
 public override void AddModelElement(Utils.IModelElement element)
 {
     {
         SubSequence item = element as SubSequence;
         if (item != null)
         {
             appendSubSequences(item);
         }
     }
 }
 /// <summary>
 /// Executes the tests in the background thread
 /// </summary>
 /// <param name="arg"></param>
 public override void ExecuteWork()
 {
     if (Window != null)
     {
         DataDictionary.Tests.SubSequence subSequence = TestCase.Enclosing as DataDictionary.Tests.SubSequence;
         if (subSequence != null)
         {
             DataDictionary.Tests.Runner.Runner runner = new DataDictionary.Tests.Runner.Runner(subSequence);
             runner.RunUntilStep(null);
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        ///     Creates a default element
        /// </summary>
        /// <param name="enclosingCollection"></param>
        /// <returns></returns>
        public static Frame CreateDefault(ICollection enclosingCollection)
        {
            Frame retVal = (Frame)acceptor.getFactory().createFrame();

            Util.DontNotify(() =>
            {
                retVal.Name = "Frame" + GetElementNumber(enclosingCollection);
                retVal.setCycleDuration("0.1");
                retVal.appendSubSequences(SubSequence.CreateDefault(retVal.SubSequences));
            });

            return(retVal);
        }
        /// <summary>
        /// Extracts the test case in a new subsequence
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void Extract(object sender, EventArgs args)
        {
            MainWindow mainWindow = MainWindow;

            mainWindow.AllowRefresh = false;

            try
            {
                DataDictionary.Tests.SubSequence subSequence = (DataDictionary.Tests.SubSequence)DataDictionary.Generated.acceptor.getFactory().createSubSequence();
                subSequence.Name = Item.Name;

                FrameTreeNode       frameTreeNode  = Parent.Parent as FrameTreeNode;
                SubSequenceTreeNode newSubSequence = frameTreeNode.createSubSequence(subSequence);

                SubSequenceTreeNode subSequenceTreeNode = Parent as SubSequenceTreeNode;
                newSubSequence.AcceptCopy((BaseTreeNode)subSequenceTreeNode.Nodes[0]);
                newSubSequence.AcceptDrop(this);
            }
            finally
            {
                mainWindow.AllowRefresh = true;
                mainWindow.RefreshModel();
            }
        }