Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 111   Methods: 9
NCLOC: 76 Classes: 6
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Framework.Container\Impl\AspectDefImplTest.cs - 46.7% 11.1% 33.3%
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 NUnit.Framework;
21   using Seasar.Framework.Aop.Interceptors;
22   using Seasar.Framework.Container;
23   using Seasar.Framework.Container.Impl;
24  
25   namespace Seasar.Tests.Framework.Container.Impl
26   {
27   /// <summary>
28   /// AspectDefImplTest の概要の説明です。
29   /// </summary>
30   [TestFixture]
31   public class AspectDefImplTest
32   {
33  
34 1 [Test]
35   public void TestSetExpression()
36   {
37 1 IS2Container container = new S2ContainerImpl();
38 1 IAspectDef ad = new AspectDefImpl();
39 1 ad.Expression = "traceAdvice";
40 1 ad.Container = container;
41 1 ComponentDefImpl cd = new ComponentDefImpl(typeof(TraceInterceptor), "traceAdvice");
42 1 container.Register(cd);
43 1 Assert.AreEqual(typeof(TraceInterceptor), ad.Aspect.MethodInterceptor.GetType());
44   }
45  
46   public class A
47   {
48   private IHoge hoge_;
49  
50 0 public A(IHoge hoge)
51   {
52   hoge_ = hoge;
53   }
54  
55 0 public string HogeName
56   {
57   get { return hoge_.Name; }
58   }
59   }
60  
61   public class A2
62   {
63   private IHoge hoge_;
64  
65 0 public IHoge Hoge
66   {
67   set { hoge_ = value; }
68   }
69  
70 0 public string HogeName
71   {
72   get { return hoge_.Name; }
73   }
74   }
75  
76   public interface IHoge
77   {
78   string Name { get; }
79   }
80  
81   public class B : IHoge
82   {
83 0 public string Name
84   {
85   get { return "B"; }
86   }
87   }
88  
89   public class C : IHoge
90   {
91   private A2 a2_;
92  
93 0 public A2 A2
94   {
95   set { a2_ = value; }
96   }
97  
98 0 public string Name
99   {
100   get { return "C"; }
101   }
102  
103 0 public string HogeName
104   {
105   get { return a2_.HogeName; }
106   }
107   }
108   }
109  
110   }
111