Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 85   Methods: 5
NCLOC: 60 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Extension.ADO\Impl\DatabaseMetaDataImplTest.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.Impl;
29   using Seasar.Extension.Unit;
30   using Seasar.Framework.Exceptions;
31  
32   namespace Seasar.Tests.Extension.ADO.Impl
33   {
34   [TestFixture]
35   public class DatabaseMetaDataImplTest : S2TestCase
36   {
37   private const string PATH = "Ado.dicon";
38  
39 1 static DatabaseMetaDataImplTest()
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 SetUpGetPrimaryKeySet()
47   {
48 1 Include(PATH);
49   }
50  
51 1 [Test, S2]
52   public void TestGetPrimaryKeySet()
53   {
54 1 DatabaseMetaDataImpl dmd = new DatabaseMetaDataImpl(this.DataSource);
55 1 IList primaryKeySet = dmd.GetPrimaryKeySet("EMP");
56  
57 1 Assert.AreEqual(1, primaryKeySet.Count);
58 1 Assert.AreEqual("EMPNO", primaryKeySet[0] as string);
59   }
60  
61 1 public void SetUpGetColumnSet()
62   {
63 1 Include(PATH);
64   }
65  
66 1 [Test, S2]
67   public void TestGetColumnSet()
68   {
69 1 DatabaseMetaDataImpl dmd = new DatabaseMetaDataImpl(this.DataSource);
70 1 IList columSet = dmd.GetColumnSet("EMP");
71  
72 1 Assert.AreEqual(9, columSet.Count);
73 1 Assert.IsTrue(columSet.Contains("EMPNO"));
74 1 Assert.IsTrue(columSet.Contains("ENAME"));
75 1 Assert.IsTrue(columSet.Contains("JOB"));
76 1 Assert.IsTrue(columSet.Contains("MGR"));
77 1 Assert.IsTrue(columSet.Contains("HIREDATE"));
78 1 Assert.IsTrue(columSet.Contains("SAL"));
79 1 Assert.IsTrue(columSet.Contains("COMM"));
80 1 Assert.IsTrue(columSet.Contains("DEPTNO"));
81 1 Assert.IsTrue(columSet.Contains("TSTAMP"));
82   }
83   }
84   }
85