예제 #1
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;
        }
예제 #2
0
        private TestVerdict getProducerStepResult(TestStep testStep, TestCaseResult testCaseResult)
        {
            TestVerdict      testVerdict        = TestVerdict.Unknown;
            TestScriptResult dependencySupplier = null;

            if (testStep.DependsOn.HasValue && testStep.DependsOn != Guid.Empty)
            {
                foreach (var testStepResult in testCaseResult.TestStepResults)
                {
                    if (testStepResult.ReferenceID == testStep.DependsOn)
                    {
                        dependencySupplier = testStepResult;
                        testVerdict        = dependencySupplier.TestVerdict;
                        break;
                    }
                }
            }

            return(testVerdict);
        }
예제 #3
0
        /// <summary>
        /// Attempts to resolve test steps dependency reference provider's test verdict.
        /// </summary>
        /// <param name="testStep">Current test step</param>
        /// <param name="testCaseResult">Current test case result.</param>
        /// <param name="explanation">Comment explaining resolution results. </param>
        /// <returns>True if test step can execute, false otherwise.</returns>
        private bool resolveExecutionDependency(TestStep testStep, TestCaseResult testCaseResult, out string explanation)
        {
            bool executeTestStep = false;

            explanation = string.Empty;

            // If there is a dependency, resolve it.
            if (testStep.DependsOn.HasValue && testStep.DependsOn != Guid.Empty)
            {
                TestScriptResult provider = null;

                // Iterate through previous test step results, looking for dependency.
                foreach (var testStepResult in testCaseResult.TestStepResults)
                {
                    // If found, evaluate continue based on test verdict.  If cannot resolve dependency, do not execute.
                    if (testStepResult.ReferenceID == testStep.DependsOn)
                    {
                        provider        = testStepResult;
                        executeTestStep = provider.TestVerdict == TestVerdict.Pass ? true : false;
                        explanation     = executeTestStep ? string.Empty : "The dependency referenced test step either did not pass or did not execute.";
                        break;
                    }
                }

                if (provider is null)
                {
                    explanation = "Unable to find referenced test step, verify this test step's \"Depends On\" value is correct.";
                }
            }
            else
            {
                executeTestStep = true;
            }

            return(executeTestStep);
        }
 internal void AddResult(TestScriptResult testScriptResult)
 {
     _testScriptResults.Add(testScriptResult);
 }
예제 #5
0
 public TestScriptObjectExecutionCompleteArgs(TestScriptResult testResult)
 {
     _testResult = testResult;
 }