Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 89   Methods: 6
NCLOC: 53 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\TooManyRegistrationRuntimeException.cs - 66.7% 66.7% 66.7%
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.Runtime.Serialization;
21   using System.Text;
22   using Seasar.Framework.Exceptions;
23  
24   namespace Seasar.Framework.Container
25   {
26   /// <summary>
27   /// TooManyRegistrationRuntimeException の概要の説明です。
28   /// </summary>
29   [Serializable]
30   public sealed class TooManyRegistrationRuntimeException : SRuntimeException
31   {
32   private object key_;
33   private Type[] componentTypes_;
34  
35   /// <summary>
36   /// コンストラクタ
37   /// </summary>
38   /// <param name="key"></param>
39   /// <param name="componentTypes"></param>
40 4 public TooManyRegistrationRuntimeException(object key,Type[] componentTypes)
41   : base("ESSR0045", new object[] {key,GetTypeNames(componentTypes)})
42   {
43 4 key_ = key;
44 4 componentTypes_ = componentTypes;
45   }
46  
47 0 public TooManyRegistrationRuntimeException(SerializationInfo info, StreamingContext context)
48   : base( info, context )
49   {
50   this.key_ = info.GetValue("key_", typeof(object));
51   this.componentTypes_ = info.GetValue("componentTypes_", typeof(Type[])) as Type[];
52   }
53  
54 0 public override void GetObjectData( SerializationInfo info,
55   StreamingContext context )
56   {
57   info.AddValue("key_", this.key_, typeof(object));
58   info.AddValue("componentTypes_", this.componentTypes_, typeof(Type[]));
59  
60   base.GetObjectData(info, context);
61   }
62  
63   public object Key
64   {
65 2 get { return key_; }
66   }
67  
68  
69   public Type[] ComponentTypes
70   {
71 6 get { return componentTypes_; }
72   }
73  
74  
75 4 public static string GetTypeNames(Type[] componentTypes)
76   {
77 4 StringBuilder buf = new StringBuilder(255);
78 4 foreach(Type componentType in componentTypes)
79   {
80 8 buf.Append(componentType.FullName);
81 8 buf.Append(", ");
82   }
83 4 buf.Length -= 2;
84 4 return buf.ToString();
85   }
86  
87   }
88   }
89