Microsoft.Test.UIAutomation.Logging.InfoObjects.StartTestInfo.ToString C# (CSharp) Méthode

ToString() public méthode

public ToString ( ) : string
Résultat string
        public override string ToString()
        {
            StringBuilder output = new StringBuilder();

            int step = 0;

            output.AppendLine("Test          : " + this.TestAttribute.TestName);
            output.AppendLine("Summary       : " + this.TestAttribute.TestSummary);
            output.AppendLine("Test Pri      : " + this.TestAttribute.Priority.ToString());
            output.AppendLine("TestCaseType  : " + this.TestAttribute.TestCaseType);
            output.AppendLine("Element       : " + this.TestAttribute.UISpyLookName);
            if (null != this.XmlNodeObjectID)
            {
                output.AppendLine("Path          : " + this.XmlNodeObjectID.InnerXml);
            }

            output.AppendLine(this.PossibleIssuesMessage);

            if (!string.IsNullOrEmpty(this.TestAttribute.ProblemDescription))
                output.AppendLine("Problem Desc : " + this.TestAttribute.ProblemDescription);

            output.AppendLine("Planned steps to be executed       :");
            foreach (string str in this.TestAttribute.Description)
            {
                output.AppendLine("             " + step++ + ") " + str);
            }

            return output.ToString();
        }
    }

Usage Example

        /// --------------------------------------------------------------------
        /// <summary></summary>
        /// --------------------------------------------------------------------
        virtual protected void LogStartTest(StartTestInfo startTestInfo)
        {
            _numberOfTests++;

            // Assume pass unless we call fail
            _testResultInfo = new TestResultInfo(TestResultInfo.TestResults.Passed);
            const string delim = "\r\n";
            string info = startTestInfo.ToString();
            int iLocE = info.IndexOf(delim);
            int iLocS = 0;

            LogComment("".PadLeft(80, '='));
            while (iLocE != -1)
            {
                LogComment(string.Format("Description : {0}", info.Substring(iLocS, iLocE - iLocS)));
                iLocS = iLocE + delim.Length;
                iLocE = info.IndexOf("\r\n", iLocS);
            }
            LogComment("".PadLeft(80, '='));

        }