Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 127   Methods: 9
NCLOC: 100 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Extension.ADO\Impl\BasicSelectHandlerTest.cs - 100.0% 100.0% 100.0%
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.Collections;
21   using System.Data;
22   using System.IO;
23   using System.Reflection;
24   using log4net;
25   using log4net.Config;
26   using log4net.Util;
27   using MbUnit.Framework;
28   using Seasar.Extension.ADO;
29   using Seasar.Extension.ADO.Impl;
30   using Seasar.Extension.Unit;
31  
32   namespace Seasar.Tests.Extension.ADO.Impl
33   {
34   [TestFixture]
35   public class BasicSelectHandlerTest : S2TestCase
36   {
37   private const string PATH = "Ado.dicon";
38  
39 1 static BasicSelectHandlerTest()
40   {
41 1 FileInfo info = new FileInfo(SystemInfo.AssemblyFileName(
42   Assembly.GetExecutingAssembly()) + ".config");
43 1 XmlConfigurator.Configure(LogManager.GetRepository(), info);
44   }
45  
46 1 public void SetUpExecute()
47   {
48 1 Include(PATH);
49   }
50  
51 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
52   public void Execute()
53   {
54 1 string sql = "select * from emp where empno = @empno";
55 1 BasicSelectHandler handler = new BasicSelectHandler(
56   DataSource,
57   sql,
58   new DictionaryDataReaderHandler()
59   );
60 1 IDictionary ret = (IDictionary) handler.Execute(new object[] { 7788 });
61 1 Console.Out.WriteLine(ret);
62 1 Assert.IsNotNull(ret, "1");
63 1 Assert.AreEqual(9, ret.Count, "2");
64   }
65  
66 1 public void SetUpExecuteNullArgs()
67   {
68 1 Include(PATH);
69   }
70  
71 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
72   public void ExecuteNullArgs()
73   {
74 1 string sql = "select * from emp where empno = 7788";
75 1 BasicSelectHandler handler = new BasicSelectHandler(
76   DataSource,
77   sql,
78   new DictionaryDataReaderHandler()
79   );
80 1 IDictionary ret = (IDictionary) handler.Execute(null);
81 1 Console.Out.WriteLine(ret);
82 1 Assert.IsNotNull(ret, "1");
83 1 Assert.AreEqual(9, ret.Count, "2");
84   }
85  
86 1 public void SetUpExecuteColonWithParam()
87   {
88 1 Include(PATH);
89   }
90  
91 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
92   public void ExecuteColonWithParam()
93   {
94 1 string sql = "select * from emp where empno = :empno";
95 1 BasicSelectHandler handler = new BasicSelectHandler(
96   DataSource,
97   sql,
98   new DictionaryDataReaderHandler()
99   );
100 1 IDictionary ret = (IDictionary) handler.Execute(new object[] { 7788 });
101 1 Console.Out.WriteLine(ret);
102 1 Assert.IsNotNull(ret, "1");
103 1 Assert.AreEqual(9, ret.Count, "2");
104   }
105  
106 1 public void SetUpExecuteQuestionWithParam()
107   {
108 1 Include(PATH);
109   }
110  
111 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
112   public void ExecuteQuestionWithParam()
113   {
114 1 string sql = "select * from emp where empno = ?";
115 1 BasicSelectHandler handler = new BasicSelectHandler(
116   DataSource,
117   sql,
118   new DictionaryDataReaderHandler()
119   );
120 1 IDictionary ret = (IDictionary) handler.Execute(new object[] { 7788 });
121 1 Console.Out.WriteLine(ret);
122 1 Assert.IsNotNull(ret, "1");
123 1 Assert.AreEqual(9, ret.Count, "2");
124   }
125   }
126   }
127