Example #1
0
 /// <summary>
 /// Fires the <see cref="TestCaseRemoved"/> event.
 /// </summary>
 /// <param name="parent">The test case group the test case is located in.</param>
 /// <param name="testCaseBase">The removed test case.</param>
 protected void OnTestCaseRemoved(TestCaseGroup parent, TestCaseBase testCaseBase)
 {
     if (TestCaseRemoved != null)
     {
         TestCaseRemoved(this, new TestCaseEventArgs(parent, testCaseBase));
     }
 }
Example #2
0
        /// <summary>
        /// Removes a given test case base from the model.
        /// </summary>
        /// <param name="parent">The parent to the item to remove.</param>
        /// <param name="testCaseBase">The test case base to remove.</param>
        private bool RemoveTestCaseBase(TestCaseGroup parent, TestCaseBase testCaseBase)
        {
            bool result = parent.TestCases.Remove(testCaseBase);

            OnTestCaseRemoved(parent, testCaseBase);

            return(result);
        }
        private TreePath GetPath(TestCaseBase testCaseBase)
        {
            List <TestCaseBase> list        = new List <TestCaseBase>();
            TestCaseBase        currentBase = testCaseBase;

            while (currentBase != null)
            {
                list.Add(currentBase);
                currentBase = currentBase.Parent;
            }
            list.Reverse();
            list.RemoveAt(0); // Remove the root group since it is only a dummy

            return(new TreePath(list.ToArray()));
        }
Example #4
0
        // ========================================================================
        // Con- / Destructors

        #region === Con- / Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TestCaseEventArgs"/> class.
        /// </summary>
        /// <param name="parent">The test case group the test case is located in.</param>
        /// <param name="testCaseBase">The test case base in question.</param>
        public TestCaseEventArgs(TestCaseGroup parent, TestCaseBase testCaseBase)
        {
            TestCaseBase = testCaseBase;
            Parent       = parent;
        }