1 // ****************************************************************
\r
2 // This is free software licensed under the NUnit license. You
\r
3 // may obtain a copy of the license as well as information regarding
\r
4 // copyright ownership at http://nunit.org/?p=license&r=2.4.
\r
5 // ****************************************************************
\r
14 /// Summary description for TestResultItem.
\r
16 public class TestResultItem
\r
18 private string testName;
\r
19 private string message;
\r
20 private string stackTrace;
\r
22 public TestResultItem(TestResult result )
\r
24 testName = result.Test.TestName.FullName;
\r
25 message = result.Message;
\r
26 stackTrace = result.StackTrace;
\r
28 if ( result.Test.IsSuite && result.FailureSite == FailureSite.SetUp )
\r
29 testName += " (TestFixtureSetUp)";
\r
32 public TestResultItem( string testName, string message, string stackTrace )
\r
34 this.testName = testName;
\r
35 this.message = message;
\r
36 this.stackTrace = stackTrace;
\r
39 public override string ToString()
\r
41 if ( message.Length > 64000 )
\r
42 return string.Format( "{0}:{1}{2}", testName, Environment.NewLine, message.Substring( 0, 64000 ) );
\r
44 return GetMessage();
\r
47 public string GetMessage()
\r
49 return String.Format("{0}:{1}{2}", testName, Environment.NewLine, message);
\r
52 public string GetToolTipMessage() //NRG 05/28/03 - Substitute spaces for tab characters
\r
54 return (ReplaceTabs(GetMessage(), 8)); // Change each tab to 8 space characters
\r
57 public string ReplaceTabs(string strOriginal, int nSpaces) //NRG 05/28/03
\r
59 string strSpaces = string.Empty;
\r
60 strSpaces = strSpaces.PadRight(nSpaces, ' ');
\r
61 return(strOriginal.Replace("\t", strSpaces));
\r
64 public string StackTrace
\r
68 string trace = "No stack trace is available";
\r
69 if(stackTrace != null)
\r
70 trace = StackTraceFilter.Filter(stackTrace);
\r