-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConverterTests.cs
54 lines (50 loc) · 1.85 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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Virinco.WATS.Interface;
namespace TerradyneSpectrumConverter
{
[TestClass]
public class ConverterTests : TDM
{
[TestMethod]
public void SetupClient()
{
RegisterClient("https://your-site-name.wats.com", "", "your-client-register-token");
InitializeAPI(true);
}
[TestMethod]
public void TestICTConverter()
{
InitializeAPI(true);
string fn = @"Examples\SampleICTTest.txt";
Dictionary<string, string> arguments = new TerradyneSpectrumICTConverter().ConverterParameters;
TerradyneSpectrumICTConverter converter = new TerradyneSpectrumICTConverter(arguments);
using (FileStream file = new FileStream(fn, FileMode.Open))
{
SetConversionSource(new FileInfo(fn), converter.ConverterParameters, null);
converter.ImportReport(this, file);
SubmitPendingReports();
}
}
[TestMethod]
public void TestXMLConverterFolder()
{
InitializeAPI(true);
Dictionary<string, string> arguments = new TerradyneSpectrumICTConverter().ConverterParameters;
TerradyneSpectrumICTConverter converter = new TerradyneSpectrumICTConverter(arguments);
foreach (string fn in Directory.GetFiles(@"Data", "*.txt"))
{
using (FileStream file = new FileStream(fn, FileMode.Open))
{
SetConversionSource(new FileInfo(fn), converter.ConverterParameters, null);
converter.ImportReport(this, file);
SubmitPendingReports();
}
}
}
}
}