2005-11-25 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / nunit24 / NUnitCore / interfaces / TestOutput.cs
1 // ****************************************************************\r
2 // Copyright 2007, Charlie Poole\r
3 // This is free software licensed under the NUnit license. You may\r
4 // obtain a copy of the license at http://nunit.org/?p=license&r=2.4\r
5 // ****************************************************************\r
6 namespace NUnit.Core\r
7 {\r
8         using System;\r
9 \r
10     /// <summary>\r
11     /// The TestOutput class holds a unit of output from \r
12     /// a test to either stdOut or stdErr\r
13     /// </summary>\r
14         [Serializable]\r
15         public class TestOutput\r
16         {\r
17                 string text;\r
18                 TestOutputType type;\r
19 \r
20         /// <summary>\r
21         /// Construct with text and an ouput destination type\r
22         /// </summary>\r
23         /// <param name="text">Text to be output</param>\r
24         /// <param name="type">Destination of output</param>\r
25                 public TestOutput(string text, TestOutputType type)\r
26                 {\r
27                         this.text = text;\r
28                         this.type = type;\r
29                 }\r
30 \r
31         /// <summary>\r
32         /// Return string representation of the object for debugging\r
33         /// </summary>\r
34         /// <returns></returns>\r
35                 public override string ToString()\r
36                 {\r
37                         return type + ": " + text;\r
38                 }\r
39 \r
40         /// <summary>\r
41         /// Get the text \r
42         /// </summary>\r
43                 public string Text\r
44                 {\r
45                         get\r
46                         {\r
47                                 return this.text;\r
48                         }\r
49                 }\r
50 \r
51         /// <summary>\r
52         /// Get the output type\r
53         /// </summary>\r
54                 public TestOutputType Type\r
55                 {\r
56                         get\r
57                         {\r
58                                 return this.type;\r
59                         }\r
60                 }\r
61         }\r
62 \r
63     /// <summary>\r
64     /// Enum representing the output destination\r
65     /// It uses combinable flags so that a given\r
66     /// output control can accept multiple types\r
67     /// of output. Normally, each individual\r
68     /// output uses a single flag value.\r
69     /// </summary>\r
70         public enum TestOutputType\r
71         {\r
72         /// <summary>\r
73         /// Send output to stdOut\r
74         /// </summary>\r
75                 Out, \r
76         \r
77         /// <summary>\r
78         /// Send output to stdErr\r
79         /// </summary>\r
80         Error,\r
81 \r
82                 /// <summary>\r
83                 /// Send output to Trace\r
84                 /// </summary>\r
85                 Trace,\r
86 \r
87                 /// <summary>\r
88                 /// Send output to Log\r
89                 /// </summary>\r
90                 Log\r
91         }\r
92 }\r