Clover.NET coverage report - Coverage

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

File Stats: LOC: 166   Methods: 10
NCLOC: 104 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Configuration\Cache\FlushInterval.cs 50.0 % 42.1 % 30.0 % 41.0 %
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 Imports
28   using System;
29   using System.Xml.Serialization;
30   #endregion
31  
32   namespace IBatisNet.DataMapper.Configuration.Cache
33   {
34   /// <summary>
35   /// Summary description for FlushInterval.
36   /// </summary>
37   [Serializable]
38   [XmlRoot("flushInterval")]
39   public class FlushInterval
40   {
41  
42   #region Fields
43  
44   private int _hours = 0;
45   private int _minutes= 0;
46   private int _seconds = 0;
47   private int _milliseconds = 0;
48   private long _interval = CacheModel.NO_FLUSH_INTERVAL;
49  
50   #endregion
51  
52   #region Properties
53   /// <summary>
54   /// Flush interval in hours
55   /// </summary>
56   [XmlAttribute("hours")]
57   public int Hours
58   {
59 0 get
60   {
61   return _hours;
62   }
63 170 set
64   {
65 170 _hours = value;
66   }
67   }
68  
69  
70   /// <summary>
71   /// Flush interval in minutes
72   /// </summary>
73 0 [XmlAttribute("minutes")]
74   public int Minutes
75   {
76   get
77   {
78   return _minutes;
79   }
80   set
81   {
82   _minutes = value;
83   }
84   }
85  
86  
87   /// <summary>
88   /// Flush interval in seconds
89   /// </summary>
90 0 [XmlAttribute("seconds")]
91   public int Seconds
92   {
93   get
94   {
95   return _seconds;
96   }
97   set
98   {
99   _seconds = value;
100   }
101   }
102  
103  
104   /// <summary>
105   /// Flush interval in milliseconds
106   /// </summary>
107 0 [XmlAttribute("milliseconds")]
108   public int Milliseconds
109   {
110   get
111   {
112   return _milliseconds;
113   }
114   set
115   {
116   _milliseconds = value;
117   }
118   }
119  
120  
121   /// <summary>
122   /// Get the flush interval value
123   /// </summary>
124   [XmlIgnoreAttribute]
125   public long Interval
126   {
127 13 get
128   {
129 13 return _interval;
130   }
131   }
132   #endregion
133  
134   #region Methods
135   /// <summary>
136   /// Calcul the flush interval value in ticks
137   /// </summary>
138 170 public void Initialize()
139   {
140 170 if (_milliseconds != 0)
141   {
142 0 _interval += (_milliseconds * TimeSpan.TicksPerMillisecond) ;
143   }
144 170 if (_seconds != 0)
145   {
146 0 _interval += (_seconds * TimeSpan.TicksPerSecond) ;
147   }
148 170 if (_minutes != 0)
149   {
150 0 _interval += (_minutes * TimeSpan.TicksPerMinute) ;
151   }
152 170 if (_hours != 0)
153   {
154 170 _interval += (_hours * TimeSpan.TicksPerHour) ;
155   }
156  
157 170 if (_interval == 0)
158   {
159 0 _interval = CacheModel.NO_FLUSH_INTERVAL;
160   }
161   }
162   #endregion
163  
164   }
165   }
166