1 // ****************************************************************
2 // This is free software licensed under the NUnit license. You
3 // may obtain a copy of the license as well as information regarding
4 // copyright ownership at http://nunit.org/?p=license&r=2.4.
5 // ****************************************************************
10 using System
.Collections
;
13 /// TestSuiteResult represents the result of running a
14 /// TestSuite. It adds a set of child results to the
15 /// base TestResult class.
19 public class TestSuiteResult
: TestResult
21 private ArrayList results
= new ArrayList();
24 /// Construct a TestSuiteResult from a test and a name
26 /// <param name="test"></param>
27 /// <param name="name"></param>
28 public TestSuiteResult(TestInfo test
, string name
)
29 : base(test
, name
) { }
32 /// Construct a TestSuite result from a string
34 /// This overload is used for testing
36 /// <param name="testSuiteString"></param>
37 public TestSuiteResult(string testSuiteString
)
38 : base(null, testSuiteString
) { }
41 /// Add a child result to a TestSuiteResult
43 /// <param name="result">The child result to be added</param>
44 public void AddResult(TestResult result
)
48 if( this.ResultState
== ResultState
.Success
&&
49 result
.ResultState
!= ResultState
.Success
)
51 this.Failure( "Child test failed", null, FailureSite
.Child
);
56 /// Gets a list of the child results of this TestSUiteResult
60 get { return results; }
64 /// Accepts a ResultVisitor
66 /// <param name="visitor">The visitor</param>
67 public override void Accept(ResultVisitor visitor
)