Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 110   Methods: 10
NCLOC: 78 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Util\DataTableInspector.cs 100.0% 56.0% 20.0% 51.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 System.Data;
21   using System.Diagnostics;
22   using System.Reflection;
23   using System.Text;
24   using Seasar.Framework.Log;
25  
26   namespace Seasar.Framework.Util
27   {
28   public class DataTableInspector
29   {
30   private static readonly Logger Log = Logger.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
31  
32 0 private DataTableInspector()
33   {
34   }
35  
36 20 public static string ToString(DataTable dataTable)
37   {
38 20 StringBuilder result = new StringBuilder();
39  
40 20 result.AppendFormat("{0}\r\n", dataTable.TableName);
41  
42 20 DataRowCollection tableRows = dataTable.Rows;
43 20 DataColumnCollection tableColumns = dataTable.Columns;
44  
45 97 for (int ctrRow = 0; ctrRow < tableRows.Count; ctrRow++)
46   {
47 77 DataRow row = tableRows[ctrRow] as DataRow;
48 77 result.AppendFormat("Row #{0}-\r\n", ctrRow + 1);
49 77 object[] rowItems = row.ItemArray;
50  
51 535 for (int ctrColumn = 0; ctrColumn < tableColumns.Count; ctrColumn++)
52   {
53 458 DataColumn column = tableColumns[ctrColumn] as DataColumn;
54 458 result.AppendFormat("\t{0}: {1}\r\n", column.ColumnName,
55   rowItems[ctrColumn].ToString());
56   }
57   }
58 20 result.Append("\r\n");
59 20 return result.ToString();
60   }
61  
62 0 public static void DebugLog(DataTable dataTable, string header)
63   {
64   string output = string.Format("{0}\r\n{1}", header,
65   DataTableInspector.ToString(dataTable));
66   Log.Debug(output);
67   }
68  
69 0 public static void DebugLog(DataTable dataTable)
70   {
71   Log.Debug(DataTableInspector.ToString(dataTable));
72   }
73  
74 0 public static void DebugWriteLine(DataTable dataTable, string header)
75   {
76   string output = string.Format("{0}\r\n{1}", header,
77   DataTableInspector.ToString(dataTable));
78   Debug.WriteLine(output);
79   }
80  
81 0 public static void DebugWriteLine(DataTable dataTable)
82   {
83   Debug.WriteLine(DataTableInspector.ToString(dataTable));
84   }
85  
86 0 public static void OutWriteLine(DataTable dataTable, string header)
87   {
88   string output = string.Format("{0}\r\n{1}", header,
89   DataTableInspector.ToString(dataTable));
90   Console.Out.WriteLine(output);
91   }
92  
93 8 public static void OutWriteLine(DataTable dataTable)
94   {
95 8 Console.Out.WriteLine(DataTableInspector.ToString(dataTable));
96   }
97  
98 0 public static void TraceWriteLine(DataTable dataTable, string header)
99   {
100   string output = string.Format("{0}\r\n{1}", header,
101   DataTableInspector.ToString(dataTable));
102   Trace.WriteLine(output);
103   }
104  
105 0 public static void TraceWriteLine(DataTable dataTable)
106   {
107   Trace.WriteLine(DataTableInspector.ToString(dataTable));
108   }
109   }
110   }