Tmx.TmxHelper.CloseTestResult C# (CSharp) Method

CloseTestResult() public static method

public static CloseTestResult ( string testResultName, string testResultId, bool testResult, bool isKnownIssue, Exception error, string description, TestResultOrigins origin, bool skipAutomatic ) : void
testResultName string
testResultId string
testResult bool
isKnownIssue bool
error System.Exception
description string
origin TestResultOrigins
skipAutomatic bool
return void
        public static void CloseTestResult(
            string testResultName, 
            string testResultId, 
            bool testResult,
            bool isKnownIssue,
            // 20160116
            // InvocationInfo myInvocation,
            // 20160116
            // ErrorRecord error,
            Exception error,
            string description,
            TestResultOrigins origin,
            bool skipAutomatic)
        {
            // 20121224
            //bool result = false;
            
//            if (TestData.TestSuites.Count == 0) {
//                TestData.InitTestData();
//            }

            TestData.AddTestResult(
                testResultName, 
                testResultId, 
                testResult, 
                isKnownIssue,
                true,
                // 20160116
                // myInvocation,
                error,
                description,
                origin,
                skipAutomatic);
        }
        #endregion Actions

Usage Example

Example #1
0
        internal override void Execute()
        {
            var cmdlet = (CloseTmxTestResultCommand)Cmdlet;

            cmdlet.ConvertTestResultStatusToTraditionalTestResult();

            cmdlet.WriteVerbose(cmdlet,
                                cmdlet.Name + ", Id = " +
                                cmdlet.Id + ", Status = " +
                                cmdlet.TestPassed);

            if (cmdlet.Echo)
            {
                cmdlet.WriteObject(
                    cmdlet,
                    cmdlet.Name +
                    "\t" +
                    cmdlet.TestPassed);
            }

            string code           = string.Empty;
            string testResultName = string.Empty;

            if (string.IsNullOrEmpty(cmdlet.Name) && !string.IsNullOrEmpty(cmdlet.TestResultName))
            {
                testResultName = cmdlet.TestResultName;
            }
            if (!string.IsNullOrEmpty(cmdlet.Name) && string.IsNullOrEmpty(cmdlet.TestResultName))
            {
                testResultName = cmdlet.Name;
            }
            if (!string.IsNullOrEmpty(cmdlet.TestResultName) && !string.IsNullOrEmpty(cmdlet.Name))
            {
                testResultName = cmdlet.TestResultName;
            }

            TmxHelper.CloseTestResult(
                testResultName,
                cmdlet.Id,
                cmdlet.TestPassed,
                cmdlet.KnownIssue,
                // 20160116
                // cmdlet.MyInvocation,
                null,
                cmdlet.Description,
                cmdlet.TestOrigin,
                true);
        }