Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 55   Methods: 2
NCLOC: 32 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\Assembler\ExpressionConstructorAssembler.cs 75.0% 100.0% 100.0% 93.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 Seasar.Framework.Util;
21  
22   namespace Seasar.Framework.Container.Assembler
23   {
24   /// <summary>
25   /// ExpressionConstructorAssembler の概要の説明です。
26   /// </summary>
27   public sealed class ExpressionConstructorAssembler : AbstractConstructorAssembler
28   {
29 54 public ExpressionConstructorAssembler(IComponentDef componentDef)
30   : base(componentDef)
31   {
32   }
33  
34 54 public override object Assemble()
35   {
36 54 IComponentDef cd = this.ComponentDef;
37 54 IS2Container container = cd.Container;
38 54 string expression = cd.Expression;
39 54 Type componentType = cd.ComponentType;
40 54 object component = JScriptUtil.Evaluate(expression,container);
41 54 if(componentType != null)
42   {
43 1 if(component is DBNull ||
44   !componentType.IsAssignableFrom(component.GetType()))
45   {
46 1 throw new TypeUnmatchRuntimeException(componentType,
47   component != null ? component.GetType() : null);
48   }
49   }
50 53 return component;
51   }
52  
53   }
54   }
55