-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConverterTests.cs
61 lines (56 loc) · 2.1 KB
/
ConverterTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using TeradyneNano51e;
using Virinco.WATS.Interface;
namespace TeradyneNano51e
{
[TestClass]
public class ConverterTests : TDM
{
[TestMethod]
public void SetupClient()
{
SetupAPI(null, "TeradyneNano51e", "ICT Tester", true);
InitializeAPI(true);
}
[TestMethod]
public void TestTeradyneNano51eConverter()
{
string fn = @"Data\exmaplefile.csv";
InitializeAPI(true);
Dictionary<string, string> arguments = new TeradyneNano51eConverter().ConverterParameters;
TeradyneNano51eConverter converter = new TeradyneNano51eConverter(arguments);
using (FileStream file = new FileStream(fn, FileMode.Open))
{
SetConversionSource(new FileInfo(fn), converter.ConverterParameters, null);
Report uut = converter.ImportReport(this, file);
}
SubmitPendingReports();
}
[TestMethod]
public void TestTeradyneNano51eConverterFolder()
{
InitializeAPI(true);
Dictionary<string, string> arguments = new TeradyneNano51eConverter().ConverterParameters;
TeradyneNano51eConverter converter = new TeradyneNano51eConverter(arguments);
string[] fileNames = Directory.GetFiles(@"Data\", "*.csv", SearchOption.AllDirectories);
Console.WriteLine(fileNames);
int count = 0;
foreach (string fileName in fileNames)
{
Console.WriteLine($"Converting {fileName}, ({++count} of {fileNames.Length})");
SetConversionSource(new FileInfo(fileName), converter.ConverterParameters, null);
using (FileStream file = new FileStream(fileName, FileMode.Open))
{
converter.ImportReport(this, file);
}
}
SubmitPendingReports();
}
}
}