Clover.NET coverage report - Coverage

Coverage timestamp: Friday, May 20, 2005 9:17:00 PM

File Stats: LOC: 123   Methods: 8
NCLOC: 67 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
DataSource.cs 50.0 % 63.6 % 75.0 % 65.2 %
coverage coverage
1  
2   #region Apache Notice
3   /*****************************************************************************
4   * $Header: $
5   * $Revision: $
6   * $Date: $
7   *
8   * iBATIS.NET Data Mapper
9   * Copyright (C) 2004 - Gilles Bayon
10   *
11   *
12   * Licensed under the Apache License, Version 2.0 (the "License");
13   * you may not use this file except in compliance with the License.
14   * You may obtain a copy of the License at
15   *
16   * http://www.apache.org/licenses/LICENSE-2.0
17   *
18   * Unless required by applicable law or agreed to in writing, software
19   * distributed under the License is distributed on an "AS IS" BASIS,
20   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   * See the License for the specific language governing permissions and
22   * limitations under the License.
23   *
24   ********************************************************************************/
25   #endregion
26  
27   #region Using
28  
29   using System;
30   using System.Xml.Serialization;
31  
32   #endregion
33  
34   namespace IBatisNet.Common
35   {
36   /// <summary>
37   /// Information about a data source.
38   /// </summary>
39   [Serializable]
40   [XmlRoot("dataSource")]
41   public class DataSource
42   {
43  
44   #region Fields
45   [NonSerialized]
46   private string _connectionString = string.Empty;
47   [NonSerialized]
48   private Provider _provider;
49   [NonSerialized]
50   private string _name = string.Empty;
51   #endregion
52  
53   #region Properties
54   /// <summary>
55   /// The connection string.
56   /// </summary>
57   [XmlAttribute("connectionString")]
58   public string ConnectionString
59   {
60 1171 get { return _connectionString; }
61 340 set
62   {
63 340 if ((value == null) || (value.Length < 1))
64 0 throw new ArgumentNullException("The connectionString attribute is mandatory in the data source " + _name);
65  
66 340 _connectionString = value;
67   }
68   }
69  
70   /// <summary>
71   /// Name used to identify the provider amongst the others.
72   /// </summary>
73   [XmlAttribute("name")]
74   public string Name
75   {
76 0 get { return _name; }
77 170 set
78   {
79 170 if ((value == null) || (value.Length < 1))
80 0 throw new ArgumentNullException("The name attribute is mandatory in the data source.");
81  
82 170 _name = value;
83   }
84   }
85  
86   /// <summary>
87   /// The provider to use for this data source.
88   /// </summary>
89   [XmlIgnore]
90   public Provider Provider
91   {
92 407140 get { return _provider; }
93 170 set
94   {
95 170 _provider = value;
96   }
97   }
98   #endregion
99  
100   #region Constructor (s) / Destructor
101   /// <summary>
102   /// Do not use direclty, only for deserialization.
103   /// </summary>
104 170 [Obsolete("This public constructor with no parameter is not really obsolete, but is reserved for serialization.", false)]
105   public DataSource()
106   {
107   }
108   #endregion
109  
110   #region Methods
111   /// <summary>
112   /// ToString implementation.
113   /// </summary>
114   /// <returns>A string that describes the data source</returns>
115 0 public override string ToString()
116   {
117   return "Source: ConnectionString : "+ConnectionString;
118   }
119   #endregion
120  
121   }
122   }
123