~nunit-core/nunitv2/2.5

« back to all changes in this revision

Viewing changes to src/NUnitFramework/core/TestSuiteResult.cs

  • Committer: jnewkirk
  • Date: 2002-07-10 20:00:13 UTC
  • Revision ID: vcs-imports@canonical.com-20020710200013-j8us5mbi0usp7p02
initialĀ load

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Copyright (C) 2002. James W. Newkirk, Michael C. Two, Alexei A. Vorontsov. All Rights Reserved.
 
3
//
 
4
namespace Nunit.Core
 
5
{
 
6
        using System;
 
7
        using System.Collections;
 
8
 
 
9
        /// <summary>
 
10
        ///             TestSuiteResult
 
11
        /// </summary>
 
12
        /// 
 
13
        [Serializable]
 
14
        public class TestSuiteResult : TestResult
 
15
        {
 
16
                private ArrayList results = new ArrayList();
 
17
                private bool executed;
 
18
                private string message;
 
19
                
 
20
                public TestSuiteResult(Test test, string name) : base(test, name)
 
21
                {
 
22
                        executed = false;
 
23
                }
 
24
 
 
25
                public bool Executed 
 
26
                {
 
27
                        get { return executed; }
 
28
                        set { executed = value; }
 
29
                }
 
30
 
 
31
                public void AddResult(TestResult result) 
 
32
                {
 
33
                        results.Add(result);
 
34
                }
 
35
 
 
36
                public override bool IsSuccess
 
37
                {
 
38
                        get 
 
39
                        {
 
40
                                bool result = true;
 
41
                                foreach(TestResult testResult in results)
 
42
                                        result &= testResult.IsSuccess;
 
43
                                return result;
 
44
                        }
 
45
                }
 
46
 
 
47
                public override bool IsFailure
 
48
                {
 
49
                        get 
 
50
                        {
 
51
                                bool result = false;
 
52
                                foreach(TestResult testResult in results)
 
53
                                        result |= testResult.IsFailure;
 
54
                                return result;
 
55
                        }
 
56
                }
 
57
 
 
58
                public override void NotRun(string message)
 
59
                {
 
60
                        this.Executed = false;
 
61
                        this.message = message;
 
62
                }
 
63
 
 
64
 
 
65
                public override string Message
 
66
                {
 
67
                        get { return message; }
 
68
                }
 
69
 
 
70
                public override string StackTrace
 
71
                {
 
72
                        get { return null; }
 
73
                }
 
74
 
 
75
 
 
76
                public IList Results
 
77
                {
 
78
                        get { return results; }
 
79
                }
 
80
 
 
81
                public override void Accept(ResultVisitor visitor) 
 
82
                {
 
83
                        visitor.visit(this);
 
84
                }
 
85
        }
 
86
}