Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 112   Methods: 14
NCLOC: 81 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Unit\S2FrameworkTestCaseBase.cs 83.3% 63.6% 50.0% 61.9%
coverage coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
4   *
5   * Licensed under the Apache License, Version 2.0 (the "License");
6   * you may not use this file except in compliance with the License.
7   * You may obtain a copy of the License at
8   *
9   * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.IO;
21   using Seasar.Framework.Container;
22   using Seasar.Framework.Container.Factory;
23   using Seasar.Framework.Util;
24  
25   namespace Seasar.Framework.Unit
26   {
27   public class S2FrameworkTestCaseBase
28   {
29   private IS2Container container;
30  
31 22 public S2FrameworkTestCaseBase()
32   {
33   }
34  
35   public IS2Container Container
36   {
37 45 get { return container; }
38 45 set { container = value; }
39   }
40  
41 0 public object GetComponent(string componentName)
42   {
43   return container.GetComponent(componentName);
44   }
45  
46 4 public object GetComponent(Type componentClass)
47   {
48 4 return container.GetComponent(componentClass);
49   }
50  
51 0 public IComponentDef GetComponentDef(string componentName)
52   {
53   return container.GetComponentDef(componentName);
54   }
55  
56 0 public IComponentDef GetComponentDef(Type componentClass)
57   {
58   return container.GetComponentDef(componentClass);
59   }
60  
61 1 public void Register(Type componentClass)
62   {
63 1 container.Register(componentClass);
64   }
65  
66 0 public void Register(Type componentClass, string componentName)
67   {
68   container.Register(componentClass, componentName);
69   }
70  
71 0 public void Register(object component)
72   {
73   container.Register(component);
74   }
75  
76 0 public void Register(object component, string componentName)
77   {
78   container.Register(component, componentName);
79   }
80  
81 0 public void Register(IComponentDef componentDef)
82   {
83   container.Register(componentDef);
84   }
85  
86 40 public void Include(string path)
87   {
88 40 S2ContainerFactory.Include(Container, ConvertPath(path));
89   }
90  
91 49 protected string ConvertPath(string path)
92   {
93 49 if (ResourceUtil.GetResourceNoException(path, this.GetType().Assembly) != null)
94   {
95 32 return path;
96   }
97 17 if (path.IndexOf('/') > 0)
98   {
99 1 return path;
100   }
101 16 if (path.IndexOf(Path.DirectorySeparatorChar) > 0)
102   {
103 0 return path;
104   }
105 16 string prefix = this.GetType().FullName.Replace('.', '/');
106 16 int pos = (prefix.LastIndexOf("/") + 1);
107 16 prefix = prefix.Substring(0, pos);
108 16 return prefix + path;
109   }
110   }
111   }
112