Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 141   Methods: 11
NCLOC: 107 Classes: 7
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Framework.Aop\Impl\PointcutImplTest.cs - 83.3% 54.5% 75.6%
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;
22   using Seasar.Framework.Aop.Impl;
23  
24   namespace Seasar.Tests.Framework.Aop.Impl
25   {
26   /// <summary>
27   /// PointcutImplTest の概要の説明です。
28   /// </summary>
29   [TestFixture]
30   public class PointcutImplTest
31   {
32 1 public PointcutImplTest()
33   {
34   }
35  
36 1 [Test]
37   public void TestGetMethodNames()
38   {
39 1 PointcutImpl pointcut = new PointcutImpl(typeof(Hello2Impl));
40 1 string[] methodNames = pointcut.MethodNames;
41 1 Assert.AreEqual(2,methodNames.Length);
42 1 foreach(string methodName in methodNames)
43   {
44 2 Console.WriteLine(methodName);
45   }
46   }
47  
48 1 [Test]
49   public void TestGetMethodNames2()
50   {
51 1 PointcutImpl pointcut = new PointcutImpl(typeof(Hello2));
52 1 string[] methodNames = pointcut.MethodNames;
53 1 Assert.AreEqual(2,methodNames.Length);
54 1 foreach(string methodName in methodNames)
55   {
56 2 Console.WriteLine(methodName);
57   }
58   }
59  
60 1 [Test]
61   public void TestGetMethodNames3()
62   {
63 1 PointcutImpl pointcut = new PointcutImpl(typeof(Hello2Impl2));
64 1 string[] methodNames = pointcut.MethodNames;
65 1 Assert.AreEqual(2,methodNames.Length);
66 1 foreach(string methodName in methodNames)
67   {
68 2 Console.WriteLine(methodName);
69   }
70   }
71  
72 1 [Test]
73   public void TestRegex()
74   {
75 1 PointcutImpl pointcut = new PointcutImpl(new string[] { "Greeting.*" });
76 1 Assert.AreEqual(true, pointcut.IsApplied("Greeting"), "1");
77 1 Assert.AreEqual(true, pointcut.IsApplied("Greeting2"), "2");
78 1 Assert.AreEqual(false, pointcut.IsApplied("TestGreetingAAA"), "3");
79 1 Assert.AreEqual(false, pointcut.IsApplied("TestGreeting"), "4");
80 1 Assert.AreEqual(false, pointcut.IsApplied("TestRegex"), "5");
81   }
82  
83 1 [Test]
84   public void testRegex2()
85   {
86 1 PointcutImpl pointcut = new PointcutImpl(new String[] { "Find" });
87 1 Assert.AreEqual(false, pointcut.IsApplied("GetFindEx"), "1");
88 1 Assert.AreEqual(false, pointcut.IsApplied("FindAll"), "2");
89 1 Assert.AreEqual(true, pointcut.IsApplied("Find"), "3");
90   }
91  
92   public interface Hello
93   {
94   string Greeting();
95   }
96  
97   public class HelloImpl : Hello
98   {
99 0 public string Greeting()
100   {
101   return "Hello";
102   }
103   }
104  
105   public class HelloInterceptor : IMethodInterceptor
106   {
107 0 public object Invoke(IMethodInvocation invocation)
108   {
109   return "Hello";
110   }
111   }
112  
113   public interface Hello2 : Hello
114   {
115   string Greeting2();
116   }
117  
118   public class Hello2Impl : HelloImpl,Hello2
119   {
120 0 public string Greeting2()
121   {
122   return "Hello2";
123   }
124   }
125  
126   public class Hello2Impl2 : Hello2
127   {
128 0 public string Greeting2()
129   {
130   return "Hello2";
131   }
132  
133 0 public string Greeting()
134   {
135   return "Hello";
136   }
137   }
138  
139   }
140   }
141