Filter() public static method

public static Filter ( string stack ) : string
stack string
return string
Exemplo n.º 1
0
        public string GetResultText()
        {
            StringBuilder builder = new StringBuilder(this.name);

            if (this.executed)
            {
                builder.AppendFormat(" [{0}s]", this.duration.ToString("##0.###"));
            }
            builder.AppendLine();
            if ((this.m_Test != null) && !string.IsNullOrEmpty(this.m_Test.testMethod.get_Description()))
            {
                builder.AppendFormat("({0})\n", this.m_Test.testMethod.get_Description().Trim());
            }
            if (!string.IsNullOrEmpty(this.message))
            {
                builder.AppendFormat("---\n{0}\n", this.message.Trim());
            }
            if (!string.IsNullOrEmpty(this.logs))
            {
                builder.AppendFormat("---\n{0}\n", this.logs.Trim());
            }
            if (!this.isSuccess && !string.IsNullOrEmpty(this.stackTrace))
            {
                string str = StackTraceFilter.Filter(this.stackTrace).Trim();
                builder.AppendFormat("---\n{0}\n", str);
            }
            if (builder.Length > 0x3a98)
            {
                builder.Length = 0x3a98;
                builder.AppendFormat("...\n\n---MESSAGE TRUNCATED AT {0} CHARACTERS---", 0x3a98);
            }
            return(builder.ToString().Trim());
        }
Exemplo n.º 2
0
 private void WriteFailureElement(ITestResult result)
 {
     this.WriteOpeningElement("failure");
     this.WriteOpeningElement("message");
     this.WriteCData(result.message);
     this.WriteClosingElement("message");
     this.WriteOpeningElement("stack-trace");
     if (result.stackTrace != null)
     {
         this.WriteCData(StackTraceFilter.Filter(result.stackTrace));
     }
     this.WriteClosingElement("stack-trace");
     this.WriteClosingElement("failure");
 }