2010-03-17 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mcs / nunit24 / NUnitCore / core / AbstractTestCaseDecoration.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 using System;\r
7 using System.Collections;\r
8 using System.Collections.Specialized;\r
9 \r
10 namespace NUnit.Core\r
11 {\r
12         /// <summary>\r
13         /// TestCaseDecorator is used to add functionality to\r
14         /// another TestCase, which it aggregates.\r
15         /// </summary>\r
16         public abstract class AbstractTestCaseDecoration : TestCase\r
17         {\r
18                 protected TestCase testCase;\r
19 \r
20                 public AbstractTestCaseDecoration( TestCase testCase )\r
21                         : base( (TestName)testCase.TestName.Clone() )\r
22                 {\r
23                         this.testCase = testCase;\r
24                         this.RunState = testCase.RunState;\r
25                         this.IgnoreReason = testCase.IgnoreReason;\r
26             this.Description = testCase.Description;\r
27             this.Categories = new System.Collections.ArrayList(testCase.Categories);\r
28             if (testCase.Properties != null)\r
29             {\r
30                 this.Properties = new ListDictionary();\r
31                 foreach (DictionaryEntry entry in testCase.Properties)\r
32                     this.Properties.Add(entry.Key, entry.Value);\r
33             }\r
34         }\r
35 \r
36                 public override int TestCount\r
37                 {\r
38                         get { return testCase.TestCount; }\r
39                 }\r
40         }\r
41 }\r