Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 144   Methods: 15
NCLOC: 111 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Tests.Extension.Unit\S2TestCaseTest.cs 50.0% 100.0% 100.0% 98.0%
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.Data;
21   using System.IO;
22   using System.Reflection;
23   using log4net;
24   using log4net.Config;
25   using log4net.Util;
26   using MbUnit.Framework;
27   using Seasar.Extension.Unit;
28   using Seasar.Framework.Log;
29   using Seasar.Framework.Util;
30  
31   namespace Seasar.Tests.Extension.Unit
32   {
33   [TestFixture]
34   public class S2TestCaseTest : S2TestCase
35   {
36   private static Logger logger = Logger.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
37   private const String PATH = "Ado.dicon";
38  
39 1 static S2TestCaseTest()
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 SetUpNotSupported()
47   {
48 1 Include(PATH);
49   }
50  
51 1 [Test, S2(Seasar.Extension.Unit.Tx.NotSupported)]
52   public void NotSupported()
53   {
54 1 logger.Debug( "NotSupported test" );
55   }
56  
57 1 public void SetUpNotSupported2()
58   {
59 1 Include(PATH);
60   }
61  
62 1 [Test, S2]
63   public void NotSupported2()
64   {
65 1 logger.Debug( "NotSupported2 test" );
66   }
67  
68 1 public void SetUpRollback()
69   {
70 1 Include(PATH);
71   }
72  
73 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
74   public void Rollback()
75   {
76 1 logger.Debug( "Rollback test" );
77   }
78  
79 1 public void SetUpCommit()
80   {
81 1 Include(PATH);
82   }
83  
84 1 [Test, S2(Seasar.Extension.Unit.Tx.Commit)]
85   public void Commit()
86   {
87 1 logger.Debug( "Commit test" );
88   }
89  
90 1 public void SetUpReadXlsTx()
91   {
92 1 Include(PATH);
93   }
94  
95 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
96   public void ReadXlsTx()
97   {
98 1 DataSet dataSet = ReadXls("testdata.xls");
99 1 DataSetInspector.OutWriteLine(dataSet);
100 1 Assert.AreEqual(2, dataSet.Tables.Count, "1");
101 1 DataTable table = dataSet.Tables["emp"];
102 1 Assert.AreEqual(2, table.Rows.Count, "2");
103 1 Assert.AreEqual(3, table.Columns.Count, "3");
104 1 DataRow row = table.Rows[0];
105 1 Assert.AreEqual(9900m, row["empno"], "4");
106 1 Assert.AreEqual("hoge", row["ename"], "5");
107 1 Assert.AreEqual("aaa", row["dname"], "6");
108   }
109  
110 1 public void SetUpReadDbByTableTx()
111   {
112 1 Include(PATH);
113   }
114  
115 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
116   public void ReadDbByTableTx()
117   {
118 1 DataTable table = ReadDbByTable("emp", "empno = 7788");
119 1 DataTableInspector.OutWriteLine(table);
120 1 Assert.AreEqual(1, table.Rows.Count, "1");
121   }
122  
123 1 public void SetUpWriteXlsTx()
124   {
125 1 Include(PATH);
126 1 string exportPath = Path.GetFullPath(ConvertPath("aaa.xls"));
127 1 if (File.Exists(exportPath))
128   {
129 1 File.Delete(Path.GetFullPath(ConvertPath("aaa.xls")));
130   }
131   }
132  
133 1 [Test, S2(Seasar.Extension.Unit.Tx.Rollback)]
134   public void WriteXlsTx()
135   {
136 1 DataSet dataSet = ReadXls("testdata.xls");
137 1 WriteXls("aaa.xls", dataSet);
138 1 DataSetInspector.OutWriteLine(dataSet);
139 1 DataSet dataSet2 = ReadXls("aaa.xls");
140 1 S2Assert.AreEqual(dataSet, dataSet2);
141   }
142   }
143   }
144