internal static void firePrepareToSaveEvent(TestScriptObject testScriptObject)
 {
     if (OnPrepareToSave != null)
     {
         OnPrepareToSave(testScriptObject);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Checks if the object has an enabled breakpoint set.
        /// </summary>
        /// <param name="testScriptObject"></param>
        /// <returns>true if set, otherwise false.</returns>
        public static bool HasEnableBreakpoint(TestScriptObject testScriptObject)
        {
            _breakpoints = _breakpoints ?? new List <TestBreakpoint>();

            return(_breakpoints is null ? false :
                   _breakpoints.Find(x => (x.TestScriptObjectID.Equals(testScriptObject.SystemID) &&
                                           x.CurrentState == TestBreakpoint.State.Enabled)) is null ? false : true);
        }
        public TestScriptObject Find(Guid systemId)
        {
            m_foundTestScriptObject = null;

            TestSuite.TraverseTestTree(this, new TestSuite.TraverseTestTreeDelegate(searchTree), systemId);

            return(m_foundTestScriptObject);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Deletes an existing breakpoint from the test script object.
        /// </summary>
        /// <param name="testScriptObject">Test script object</param>
        public static void DeleteBreakpoint(TestScriptObject testScriptObject)
        {
            var breakpoint = _breakpoints.Find(x => x.TestScriptObjectID.Equals(testScriptObject.SystemID));

            if (null != breakpoint)
            {
                DeleteBreakpoint(breakpoint);
            }
        }
 public TestExecutionCompleteArgs(string virtualUser, TestScriptObject testScriptObject,
                                  TerminationReason terminationSource, TimeSpan elapsedTime, string explanation = null)
 {
     _virtualUser       = virtualUser;
     _testScriptObject  = testScriptObject;
     _terminationSource = terminationSource;
     _explanation       = explanation;
     _elapsedTime       = elapsedTime;
 }
Exemplo n.º 6
0
        private bool filterTestSuite(TestScriptObject testScriptObject, object tag)
        {
            if (testScriptObject is TestCase && isQualified(testScriptObject as TestCase, tag as TestFilter))
            {
                _qualifiedTestCases.Add((TestCase)testScriptObject);
            }

            return(true);
        }
 internal TestScriptObject(TestScriptObject orignalTestScriptObject, TestScriptObjectContainer parent)
     : base(orignalTestScriptObject)
 {
     this._parentID    = parent != null ? parent.SystemID : Guid.Empty;
     this._userId      = orignalTestScriptObject._userId;
     this._title       = TestUtils.SafeCopyString(orignalTestScriptObject._title);
     this._description = TestUtils.SafeCopyString(orignalTestScriptObject._description);
     this._status      = orignalTestScriptObject._status;
 }
Exemplo n.º 8
0
 public TestChangeEvent(TestScriptObject testScriptObject, ChangeType editAction,
                        string property, object currentValue, object formerValue, object tag = null)
 {
     this.m_testScriptObject = testScriptObject;
     this.m_changeType       = editAction;
     this.m_property         = property;
     this.m_currentState     = currentValue;
     this.m_formerState      = formerValue;
     this.m_tag = tag;
 }
        internal TestScriptObject(string title, TestScriptObject parent)
            : this()
        {
            _title = title;

            if (parent != null)
            {
                _parentID = parent.SystemID;
            }
        }
        private bool searchTree(TestScriptObject testScriptObject, object tag)
        {
            bool @continue = true;

            if (testScriptObject.SystemID == (Guid)tag)
            {
                m_foundTestScriptObject = testScriptObject;
                @continue = false;
            }

            return(@continue);
        }
Exemplo n.º 11
0
        private bool availableTestCases(TestScriptObject testScriptObject, object tag)
        {
            if (testScriptObject is TestCase && testScriptObject.Status == Core.Status.Active)
            {
                if (isTestCaseReachable((TestCase)testScriptObject))
                {
                    _available = _available + 1;
                }
            }

            return(true);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Inserts a breakpoint for the test script object.
        /// </summary>
        /// <param name="testScriptObject">Test script object</param>
        public static TestBreakpoint InsertBreakpoint(TestScriptObject testScriptObject)
        {
            _breakpoints = _breakpoints ?? new List <TestBreakpoint>();

            var breakpoint = new TestBreakpoint(testScriptObject);

            _breakpoints.Add(breakpoint);

            WriteToFile();

            FireTestBreakpointInsertedEvent(breakpoint, new TestBreakPointArgs());

            return(breakpoint);
        }
Exemplo n.º 13
0
        public TestScriptResultComposite(TestScriptObject testScriptObject, TestScriptResult testScriptResult)
        {
            TestAssert.IsTrue(testScriptObject.SystemID.CompareTo(testScriptResult.ReferenceID) == 0,
                              "Test test script result is not applicable to the specified script object.");

            ParentID    = testScriptObject.ParentID;
            UserID      = testScriptObject.UserID;
            Title       = testScriptObject.Title;
            Description = testScriptObject.Description;
            Status      = testScriptObject.Status;

            VirtualUser = testScriptResult.VirtualUser;
            TestVerdict = testScriptResult.TestVerdict;
            TestMessage = testScriptResult.TestMessage;
            StartTime   = testScriptResult.StartTime;
            EndTime     = testScriptResult.EndTime;
            ElapsedTime = testScriptResult.ElapsedTime;
        }
Exemplo n.º 14
0
        public static void TraverseTestTree(TestScriptObject testScriptObject, TraverseTestTreeDelegate traverseTestTreeDelegate, object tag)
        {
            m_continue = traverseTestTreeDelegate(testScriptObject, tag);

            if (m_continue)
            {
                if (testScriptObject is TestScriptObjectContainer)
                {
                    var container = testScriptObject as TestScriptObjectContainer;

                    foreach (TestScriptObject testscript in container.TestScriptObjects)
                    {
                        TraverseTestTree(testscript, traverseTestTreeDelegate, tag);

                        if (!m_continue)
                        {
                            break;
                        }
                    }
                }
            }
        }
        public TestScriptObjectContainer(TestScriptObjectContainer originalTestScriptObjectContainer, TestScriptObjectContainer parent)
            : base(originalTestScriptObjectContainer, parent)
        {
            _functionalArea = TestUtils.SafeCopyString(originalTestScriptObjectContainer._functionalArea);
            _reference      = TestUtils.SafeCopyString(originalTestScriptObjectContainer._reference);
            _author         = Environment.UserName;
            _created        = originalTestScriptObjectContainer._created;

            _testProperties = new TestPropertyCollection();

            foreach (TestProperty testProperty in originalTestScriptObjectContainer._testProperties)
            {
                _testProperties.Add(new TestProperty(testProperty));
            }

            _testScriptObjects = new TestScriptObjectCollection();

            foreach (TestScriptObject testScriptObject in originalTestScriptObjectContainer._testScriptObjects)
            {
                TestScriptObject newObject = null;

                if (testScriptObject is TestSuite)
                {
                    newObject = new TestSuite((TestSuite)testScriptObject, null, (TestSuite)this);
                }
                else if (testScriptObject is TestCase)
                {
                    newObject = new TestCase((TestCase)testScriptObject, (TestSuite)this);
                }
                else if (testScriptObject is TestStep)
                {
                    newObject = new TestStep((TestStep)testScriptObject, (TestCase)this);
                }

                _testScriptObjects.Add(newObject);
            }
        }
Exemplo n.º 16
0
 public TestExecutionBeginArgs(string virtualUser, TestScriptObject testScriptObject)
 {
     _virtualUser      = virtualUser;
     _testScriptObject = testScriptObject;
 }
 public TestScriptObject Find(TestScriptObject testScriptObject)
 {
     return(Find(testScriptObject.SystemID));
 }
Exemplo n.º 18
0
 public TestScriptObject AddTestScriptObject(TestScriptObject testScriptObject)
 {
     return(AddTestScriptObject(testScriptObject, -1));
 }
Exemplo n.º 19
0
 /// <summary>
 /// Enters execution break at test script object.
 /// </summary>
 /// <param name="testScriptObject"></param>
 public static void EnterBreakpoint(TestScriptObject testScriptObject)
 {
     EnterBreakpoint(testScriptObject.SystemID);
 }
Exemplo n.º 20
0
 public static TestBreakpoint GetBreakpoint(TestScriptObject testScriptObject)
 {
     return(GetBreakpoint(testScriptObject.SystemID));
 }
Exemplo n.º 21
0
 public bool ConstructNodeTree(QTF.TestScriptObject testScriptObject)
 {
     QTF.TestTrace.Trace(testScriptObject.Title);
     return(true);
 }
Exemplo n.º 22
0
        /// <summary>
        /// Checks if the object has a breakpoint set.
        /// </summary>
        /// <param name="testScriptObject"></param>
        /// <returns>true if set, otherwise false.</returns>
        public static bool HasBreakpoint(TestScriptObject testScriptObject)
        {
            _breakpoints = _breakpoints ?? new List <TestBreakpoint>();

            return(_breakpoints is null ? false : _breakpoints.Find(x => x.TestScriptObjectID.Equals(testScriptObject.SystemID)) is null ? false : true);
        }
Exemplo n.º 23
0
 public bool TraceOut(QTF.TestScriptObject testScriptObject)
 {
     QTF.TestTrace.Trace(testScriptObject.ToString());
     return(true);
 }
 public void SetParent(TestScriptObject parent)
 {
     _parentID = parent.SystemID;
 }
 public void TestExecutionStopRequest(QTF.TestScriptObject testScriptObject, QTF.TestExecutionStopRequestArgs eventArgs)
 {
     // Enter runtime event handler code here
 }
 public int FindTestScriptObjectIndex(TestScriptObject testScriptObject)
 {
     return(this.TestScriptObjects.FindIndex(x => x.SystemID == testScriptObject.SystemID));
 }
 public TestScriptObject InsertTestScriptObject(TestScriptObject testScriptObject, int index)
 {
     testScriptObject.SetParent(this);
     _testScriptObjects.Insert(index == -1 ? _testScriptObjects.Count : index, testScriptObject);
     return(testScriptObject);
 }
 public TestScriptObject InsertTestScriptObject(TestScriptObject testScriptObject)
 {
     return(InsertTestScriptObject(testScriptObject, -1));
 }
 public bool RemoveTestScriptObject(TestScriptObject testScriptObject)
 {
     return(_testScriptObjects.Remove(testScriptObject));
 }
Exemplo n.º 30
0
 void TestScriptObject_OnPrepareToSave(TestScriptObject testScriptObject)
 {
 }