// **************************************************************** // This is free software licensed under the NUnit license. You // may obtain a copy of the license as well as information regarding // copyright ownership at http://nunit.org/?p=license&r=2.4. // **************************************************************** namespace NUnit.Core { using System; using System.Collections; /// /// TestSuiteResult represents the result of running a /// TestSuite. It adds a set of child results to the /// base TestResult class. /// /// [Serializable] public class TestSuiteResult : TestResult { private ArrayList results = new ArrayList(); /// /// Construct a TestSuiteResult from a test and a name /// /// /// public TestSuiteResult(TestInfo test, string name) : base(test, name) { } /// /// Construct a TestSuite result from a string /// /// This overload is used for testing /// /// public TestSuiteResult(string testSuiteString) : base(null, testSuiteString) { } /// /// Add a child result to a TestSuiteResult /// /// The child result to be added public void AddResult(TestResult result) { results.Add(result); if( this.ResultState == ResultState.Success && result.ResultState != ResultState.Success ) { this.Failure( "Child test failed", null, FailureSite.Child ); } } /// /// Gets a list of the child results of this TestSUiteResult /// public IList Results { get { return results; } } /// /// Accepts a ResultVisitor /// /// The visitor public override void Accept(ResultVisitor visitor) { visitor.Visit(this); } } }