Exemple #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;
        }
        virtual internal TestProcessorResult Execute()
        {
            TestProcessorResult result = new TestProcessorResult();

            TestAssert.IsTrue(TestAutomationDefinition.IsCompleted(),
                              "The test suite's processor is \"Active\", however its automation definition is incomplete.");

            var resultStruct = TestAutomationDefinition.Invoke(null);

            result.SetReferenceID(SystemID);
            result.SetVirtualUser(Thread.CurrentThread.Name);
            result.SetStartTime(resultStruct.StartTime);
            result.SetEndTime(resultStruct.EndTime);
            result.SetTestVerdict(resultStruct.TestVerdict);
            result.SetTestMessage(resultStruct.TestMessage);
            result.SetTestChecks(resultStruct.TestChecks);
            result.SetTestWarnings(resultStruct.TestWarnings);

            return(result);
        }