Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 93   Methods: 6
NCLOC: 66 Classes: 3
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Framework.Util\ClassUtilTest.cs - 83.3% 83.3% 83.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 System.Reflection;
22   using Seasar.Framework.Util;
23   using Seasar.Framework.Exceptions;
24  
25   namespace Seasar.Tests.Framework.Util
26   {
27   /// <summary>
28   /// ClassUtilTest の概要の説明です。
29   /// </summary>
30   [TestFixture]
31   public class ClassUtilTest
32   {
33 1 [Test]
34   public void TestGetConstructorInfo()
35   {
36 1 try
37   {
38 1 ConstructorInfo constructor = ClassUtil.GetConstructorInfo(
39   typeof(A),Type.EmptyTypes);
40 0 Assert.Fail();
41   }
42   catch(NoSuchConstructorRuntimeException ex)
43   {
44 1 Console.WriteLine(ex.Message);
45   }
46 1 Type[] types = new Type[] { typeof(string) };
47 1 ConstructorInfo constructor2 = ClassUtil.GetConstructorInfo(
48   typeof(A), types);
49 1 Assert.IsNotNull(constructor2);
50   }
51  
52 1 [Test]
53   public void TestForName()
54   {
55 1 Assembly asm = Assembly.GetExecutingAssembly();
56 1 Assert.AreEqual(typeof(A), ClassUtil.ForName(
57   "Seasar.Tests.Framework.Util.ClassUtilTest+A",
58   new Assembly[] {asm}));
59   }
60  
61 1 [Test]
62   public void TestNewInstance()
63   {
64 1 Assert.IsNotNull(ClassUtil.NewInstance(typeof(B)));
65   }
66  
67 1 [Test]
68   public void TestNewInstance2()
69   {
70 1 Assert.IsNotNull(ClassUtil.NewInstance(
71   "Seasar.Tests.Framework.Util.ClassUtilTest+B",
72   "Seasar.Tests.dll"));
73   }
74  
75   public class A
76   {
77   private string abc_;
78  
79 0 public A(string abc)
80   {
81   abc_ = abc;
82   }
83   }
84  
85   public class B
86   {
87 1 public B()
88   {
89   }
90   }
91   }
92   }
93