Revize 3729dcae
Přidáno uživatelem Alex Konig před více než 3 roky(ů)
Server/ServerAppFunctionalTests/ParserTests/JisParserTesting.cs | ||
---|---|---|
162 | 162 |
|
163 | 163 |
Assert.AreEqual(0, retVal.Count); |
164 | 164 |
} |
165 |
|
|
166 |
[TestMethod] |
|
167 |
public void ParseJisDayEmpty() |
|
168 |
{ |
|
169 |
string path = ""; |
|
170 |
List<WeatherInstance> data = new List<WeatherInstance>(); |
|
171 |
|
|
172 |
Mock<IDataLoader> dl = new Mock<IDataLoader>(); |
|
173 |
dl.Setup(m => m.LoadWeatherFile(path)).Returns(data); |
|
174 |
|
|
175 |
JisParser target = new JisParser(dl.Object); |
|
176 |
PrivateObject obj = new PrivateObject(target); |
|
177 |
|
|
178 |
List<ActivityInfo> retVal = (List<ActivityInfo>)obj.Invoke("ProcessOneJisFileAsDays", path, new DateTime(2000, 1, 1, 8, 0, 0), new DateTime(2001, 1, 1, 11, 0, 0)); |
|
179 |
|
|
180 |
Assert.AreEqual(0, retVal.Count); |
|
181 |
} |
|
182 |
|
|
183 |
|
|
184 |
[TestMethod] |
|
185 |
public void ParseJisDayNull() |
|
186 |
{ |
|
187 |
string path = ""; |
|
188 |
List<WeatherInstance> data = null; |
|
189 |
|
|
190 |
Mock<IDataLoader> dl = new Mock<IDataLoader>(); |
|
191 |
dl.Setup(m => m.LoadWeatherFile(path)).Returns(data); |
|
192 |
|
|
193 |
JisParser target = new JisParser(dl.Object); |
|
194 |
PrivateObject obj = new PrivateObject(target); |
|
195 |
|
|
196 |
List<ActivityInfo> retVal = (List<ActivityInfo>)obj.Invoke("ProcessOneJisFileAsDays", path, new DateTime(2000, 1, 1, 8, 0, 0), new DateTime(2001, 1, 1, 11, 0, 0)); |
|
197 |
|
|
198 |
Assert.AreEqual(0, retVal.Count); |
|
199 |
} |
|
165 | 200 |
#endregion |
166 | 201 |
|
167 | 202 |
#region Parse hours |
203 |
|
|
204 |
[TestMethod] |
|
205 |
public void ParseJisEmpty() |
|
206 |
{ |
|
207 |
string path = ""; |
|
208 |
List<WeatherInstance> data = new List<WeatherInstance>(); |
|
209 |
|
|
210 |
Mock<IDataLoader> dl = new Mock<IDataLoader>(); |
|
211 |
dl.Setup(m => m.LoadWeatherFile(path)).Returns(data); |
|
212 |
|
|
213 |
JisParser target = new JisParser(dl.Object); |
|
214 |
PrivateObject obj = new PrivateObject(target); |
|
215 |
|
|
216 |
List<ActivityInfo> retVal = (List<ActivityInfo>)obj.Invoke("ProcessOneJisFileAsIntervals", path, 2, new DateTime(2000, 1, 1, 8, 0, 0), new DateTime(2001, 1, 1, 11, 0, 0)); |
|
217 |
|
|
218 |
Assert.AreEqual(0, retVal.Count); |
|
219 |
} |
|
220 |
|
|
221 |
|
|
222 |
[TestMethod] |
|
223 |
public void ParseJisNull() |
|
224 |
{ |
|
225 |
string path = ""; |
|
226 |
List<WeatherInstance> data = null; |
|
227 |
|
|
228 |
Mock<IDataLoader> dl = new Mock<IDataLoader>(); |
|
229 |
dl.Setup(m => m.LoadWeatherFile(path)).Returns(data); |
|
230 |
|
|
231 |
JisParser target = new JisParser(dl.Object); |
|
232 |
PrivateObject obj = new PrivateObject(target); |
|
233 |
|
|
234 |
List<ActivityInfo> retVal = (List<ActivityInfo>)obj.Invoke("ProcessOneJisFileAsIntervals", path, 2, new DateTime(2000, 1, 1, 8, 0, 0), new DateTime(2001, 1, 1, 11, 0, 0)); |
|
235 |
|
|
236 |
Assert.AreEqual(0, retVal.Count); |
|
237 |
} |
|
238 |
|
|
168 | 239 |
[TestMethod] |
169 | 240 |
public void ParseJisHourlyOne() |
170 | 241 |
{ |
Také k dispozici: Unified diff
re #9037 Empty input testing