Changeset 9885 for stable/HeuristicLab.Tests/HeuristicLab.Problems.Instances.DataAnalysis-3.3/TableFileParserTest.cs
- Timestamp:
- 08/20/13 17:03:31 (11 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9764-9775,9777-9778,9782-9786,9792,9803,9806-9807,9810
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 9764-9775,9777-9778,9782-9786,9792,9803,9806
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab.Problems.Instances.DataAnalysis-3.3/TableFileParserTest.cs
r9651 r9885 22 22 using System; 23 23 using System.IO; 24 using HeuristicLab.Problems.Instances.DataAnalysis;25 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 26 25 27 namespace HeuristicLab.Problems.Instances.DataAnalysis_34.Tests { 28 26 namespace HeuristicLab.Problems.Instances.DataAnalysis.Tests { 29 27 [TestClass()] 30 28 public class TableFileParserTest { 31 32 [TestMethod] 29 [TestMethod] 30 [TestCategory("Problems.Instances")] 31 [TestProperty("Time", "short")] 33 32 public void ParseCSV() { 34 33 string tempFileName = Path.GetTempFileName(); … … 46 45 Assert.AreEqual(4, parser.Columns); 47 46 Assert.AreEqual(parser.Values[3][0], 3.14); 48 } 49 finally { 50 File.Delete(tempFileName); 51 } 52 } 53 [TestMethod] 47 } finally { 48 File.Delete(tempFileName); 49 } 50 } 51 52 [TestMethod] 53 [TestCategory("Problems.Instances")] 54 [TestProperty("Time", "short")] 54 55 public void ParseCSVWithNames() { 55 56 string tempFileName = Path.GetTempFileName(); … … 68 69 Assert.AreEqual(4, parser.Columns); 69 70 Assert.AreEqual(parser.Values[3][0], 3.14); 70 } 71 finally { 72 File.Delete(tempFileName); 73 } 74 } 75 76 [TestMethod] 71 } finally { 72 File.Delete(tempFileName); 73 } 74 } 75 76 [TestMethod] 77 [TestCategory("Problems.Instances")] 78 [TestProperty("Time", "short")] 77 79 public void ParseGermanCSV() { 78 80 string tempFileName = Path.GetTempFileName(); … … 90 92 Assert.AreEqual(4, parser.Columns); 91 93 Assert.AreEqual(parser.Values[3][0], 3.14); 92 } 93 finally { 94 File.Delete(tempFileName); 95 } 96 } 97 98 [TestMethod] 94 } finally { 95 File.Delete(tempFileName); 96 } 97 } 98 99 [TestMethod] 100 [TestCategory("Problems.Instances")] 101 [TestProperty("Time", "short")] 99 102 public void ParseGermanCSVWithNames() { 100 103 string tempFileName = Path.GetTempFileName(); … … 113 116 Assert.AreEqual(4, parser.Columns); 114 117 Assert.AreEqual(parser.Values[3][0], 3.14); 115 } 116 finally { 117 File.Delete(tempFileName); 118 } 119 } 120 121 [TestMethod] 118 } finally { 119 File.Delete(tempFileName); 120 } 121 } 122 123 [TestMethod] 124 [TestCategory("Problems.Instances")] 125 [TestProperty("Time", "short")] 122 126 public void ParseGermanCSVWithoutCommas() { 123 127 string tempFileName = Path.GetTempFileName(); … … 135 139 Assert.AreEqual(4, parser.Columns); 136 140 Assert.AreEqual((double)parser.Values[3][0], 3); 137 } 138 finally { 139 File.Delete(tempFileName); 140 } 141 } 142 [TestMethod] 141 } finally { 142 File.Delete(tempFileName); 143 } 144 } 145 146 [TestMethod] 147 [TestCategory("Problems.Instances")] 148 [TestProperty("Time", "short")] 143 149 public void ParseGermanCSVWithoutCommasWithNames() { 144 150 string tempFileName = Path.GetTempFileName(); … … 157 163 Assert.AreEqual(4, parser.Columns); 158 164 Assert.AreEqual((double)parser.Values[3][0], 3); 159 } 160 finally { 161 File.Delete(tempFileName); 162 } 163 } 164 165 [TestMethod] 165 } finally { 166 File.Delete(tempFileName); 167 } 168 } 169 170 [TestMethod] 171 [TestCategory("Problems.Instances")] 172 [TestProperty("Time", "short")] 166 173 public void ParseEnglishCSVWithoutCommas() { 167 174 string tempFileName = Path.GetTempFileName(); … … 179 186 Assert.AreEqual(4, parser.Columns); 180 187 Assert.AreEqual((double)parser.Values[3][0], 3); 181 } 182 finally { 183 File.Delete(tempFileName); 184 } 185 } 186 187 [TestMethod] 188 } finally { 189 File.Delete(tempFileName); 190 } 191 } 192 193 [TestMethod] 194 [TestCategory("Problems.Instances")] 195 [TestProperty("Time", "short")] 188 196 public void ParseEnglishCSVWithoutCommasWithoutSpace() { 189 197 string tempFileName = Path.GetTempFileName(); … … 201 209 Assert.AreEqual(4, parser.Columns); 202 210 Assert.AreEqual((double)parser.Values[3][0], 3); 203 } 204 finally { 205 File.Delete(tempFileName); 206 } 207 } 208 209 [TestMethod] 211 } finally { 212 File.Delete(tempFileName); 213 } 214 } 215 216 [TestMethod] 217 [TestCategory("Problems.Instances")] 218 [TestProperty("Time", "short")] 210 219 public void ParseEnglishCSVWithoutCommasWithNames() { 211 220 string tempFileName = Path.GetTempFileName(); … … 224 233 Assert.AreEqual(4, parser.Columns); 225 234 Assert.AreEqual((double)parser.Values[3][0], 3); 226 } 227 finally { 228 File.Delete(tempFileName); 229 } 230 } 231 232 [TestMethod] 235 } finally { 236 File.Delete(tempFileName); 237 } 238 } 239 240 [TestMethod] 241 [TestCategory("Problems.Instances")] 242 [TestProperty("Time", "short")] 233 243 public void ParseEnglishCSVWithoutCommasWithoutSpacesWithNames() { 234 244 string tempFileName = Path.GetTempFileName(); … … 247 257 Assert.AreEqual(4, parser.Columns); 248 258 Assert.AreEqual((double)parser.Values[3][0], 3); 249 } 250 finally { 251 File.Delete(tempFileName); 252 } 253 } 254 255 256 [TestMethod] 259 } finally { 260 File.Delete(tempFileName); 261 } 262 } 263 264 265 [TestMethod] 266 [TestCategory("Problems.Instances")] 267 [TestProperty("Time", "short")] 257 268 public void ParseGermanTabSeparated() { 258 269 string tempFileName = Path.GetTempFileName(); … … 270 281 Assert.AreEqual(4, parser.Columns); 271 282 Assert.AreEqual((double)parser.Values[3][0], 3.14); 272 } 273 finally { 274 File.Delete(tempFileName); 275 } 276 } 277 278 [TestMethod] 283 } finally { 284 File.Delete(tempFileName); 285 } 286 } 287 288 [TestMethod] 289 [TestCategory("Problems.Instances")] 290 [TestProperty("Time", "short")] 279 291 public void ParseGermanTabSeparatedWithNames() { 280 292 string tempFileName = Path.GetTempFileName(); … … 293 305 Assert.AreEqual(4, parser.Columns); 294 306 Assert.AreEqual((double)parser.Values[3][0], 3.14); 295 } 296 finally { 297 File.Delete(tempFileName); 298 } 299 } 300 301 [TestMethod] 307 } finally { 308 File.Delete(tempFileName); 309 } 310 } 311 312 [TestMethod] 313 [TestCategory("Problems.Instances")] 314 [TestProperty("Time", "short")] 302 315 public void ParseEnglishTabSeparated() { 303 316 string tempFileName = Path.GetTempFileName(); … … 315 328 Assert.AreEqual(4, parser.Columns); 316 329 Assert.AreEqual((double)parser.Values[3][0], 3.14); 317 } 318 finally { 319 File.Delete(tempFileName); 320 } 321 } 322 [TestMethod] 330 } finally { 331 File.Delete(tempFileName); 332 } 333 } 334 335 [TestMethod] 336 [TestCategory("Problems.Instances")] 337 [TestProperty("Time", "short")] 323 338 public void ParseEnglishTabSeparatedWithNames() { 324 339 string tempFileName = Path.GetTempFileName(); … … 337 352 Assert.AreEqual(4, parser.Columns); 338 353 Assert.AreEqual((double)parser.Values[3][0], 3.14); 339 } 340 finally { 341 File.Delete(tempFileName); 342 } 343 } 344 345 [TestMethod] 354 } finally { 355 File.Delete(tempFileName); 356 } 357 } 358 359 [TestMethod] 360 [TestCategory("Problems.Instances")] 361 [TestProperty("Time", "short")] 346 362 public void ParseTabSeparatedWithoutCommas() { 347 363 string tempFileName = Path.GetTempFileName(); … … 359 375 Assert.AreEqual(4, parser.Columns); 360 376 Assert.AreEqual((double)parser.Values[3][0], 3); 361 } 362 finally { 363 File.Delete(tempFileName); 364 } 365 } 366 [TestMethod] 377 } finally { 378 File.Delete(tempFileName); 379 } 380 } 381 382 [TestMethod] 383 [TestCategory("Problems.Instances")] 384 [TestProperty("Time", "short")] 367 385 public void ParseTabSeparatedWithoutCommasWithNames() { 368 386 string tempFileName = Path.GetTempFileName(); … … 381 399 Assert.AreEqual(4, parser.Columns); 382 400 Assert.AreEqual((double)parser.Values[3][0], 3); 383 } 384 finally { 385 File.Delete(tempFileName); 386 } 387 } 388 389 [TestMethod] 401 } finally { 402 File.Delete(tempFileName); 403 } 404 } 405 406 [TestMethod] 407 [TestCategory("Problems.Instances")] 408 [TestProperty("Time", "short")] 390 409 public void ParseWithEmtpyLines() { 391 410 string tempFileName = Path.GetTempFileName(); … … 403 422 Assert.AreEqual(4, parser.Rows); 404 423 Assert.AreEqual(4, parser.Columns); 405 } 406 finally { 407 File.Delete(tempFileName); 408 } 409 } 410 411 [TestMethod] 424 } finally { 425 File.Delete(tempFileName); 426 } 427 } 428 429 [TestMethod] 430 [TestCategory("Problems.Instances")] 431 [TestProperty("Time", "short")] 412 432 public void ParseGermanSpaceSeparated() { 413 433 string tempFileName = Path.GetTempFileName(); … … 425 445 Assert.AreEqual(4, parser.Columns); 426 446 Assert.AreEqual((double)parser.Values[3][0], 3.14); 427 } 428 finally { 429 File.Delete(tempFileName); 430 } 431 } 432 [TestMethod] 447 } finally { 448 File.Delete(tempFileName); 449 } 450 } 451 452 [TestMethod] 453 [TestCategory("Problems.Instances")] 454 [TestProperty("Time", "short")] 433 455 public void ParseGermanSpaceSeparatedWithNames() { 434 456 string tempFileName = Path.GetTempFileName(); … … 447 469 Assert.AreEqual(4, parser.Columns); 448 470 Assert.AreEqual((double)parser.Values[3][0], 3.14); 449 } 450 finally { 451 File.Delete(tempFileName); 452 } 453 } 454 455 [TestMethod] 471 } finally { 472 File.Delete(tempFileName); 473 } 474 } 475 476 [TestMethod] 477 [TestCategory("Problems.Instances")] 478 [TestProperty("Time", "short")] 456 479 public void ParseEnglishSpaceSeparated() { 457 480 string tempFileName = Path.GetTempFileName(); … … 469 492 Assert.AreEqual(4, parser.Columns); 470 493 Assert.AreEqual((double)parser.Values[3][0], 3.14); 471 } 472 finally { 473 File.Delete(tempFileName); 474 } 475 } 476 [TestMethod] 494 } finally { 495 File.Delete(tempFileName); 496 } 497 } 498 499 [TestMethod] 500 [TestCategory("Problems.Instances")] 501 [TestProperty("Time", "short")] 477 502 public void ParseEnglishSpaceSeparatedWithNames() { 478 503 string tempFileName = Path.GetTempFileName(); … … 491 516 Assert.AreEqual(4, parser.Columns); 492 517 Assert.AreEqual((double)parser.Values[3][0], 3.14); 493 } 494 finally { 495 File.Delete(tempFileName); 496 } 497 } 498 499 [TestMethod] 518 } finally { 519 File.Delete(tempFileName); 520 } 521 } 522 523 [TestMethod] 524 [TestCategory("Problems.Instances")] 525 [TestProperty("Time", "short")] 500 526 public void ParseEnglishSpaceSeparatedWithNamesManyColumns() { 501 527 string tempFileName = Path.GetTempFileName(); … … 511 537 Assert.AreEqual(3, parser.Rows); 512 538 Assert.AreEqual(4507, parser.Columns); 513 } 514 finally { 515 File.Delete(tempFileName); 516 } 517 } 518 519 [TestMethod] 539 } finally { 540 File.Delete(tempFileName); 541 } 542 } 543 544 [TestMethod] 545 [TestCategory("Problems.Instances")] 546 [TestProperty("Time", "short")] 520 547 public void ParseSpaceSeparatedWithoutCommas() { 521 548 string tempFileName = Path.GetTempFileName(); … … 533 560 Assert.AreEqual(4, parser.Columns); 534 561 Assert.AreEqual((double)parser.Values[3][0], 3); 535 } 536 finally { 537 File.Delete(tempFileName); 538 } 539 } 540 [TestMethod] 562 } finally { 563 File.Delete(tempFileName); 564 } 565 } 566 567 [TestMethod] 568 [TestCategory("Problems.Instances")] 569 [TestProperty("Time", "short")] 541 570 public void ParseSpaceSeparatedWithoutCommasWithNames() { 542 571 string tempFileName = Path.GetTempFileName(); … … 555 584 Assert.AreEqual(4, parser.Columns); 556 585 Assert.AreEqual((double)parser.Values[3][0], 3); 557 } 558 finally { 586 } finally { 559 587 File.Delete(tempFileName); 560 588 }
Note: See TracChangeset
for help on using the changeset viewer.