-
Notifications
You must be signed in to change notification settings - Fork 0
/
_T_UnitsFile.cs
48 lines (32 loc) · 1 KB
/
_T_UnitsFile.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
using NUnit.Framework;
using AeroCalcCore;
using System.IO;
using System;
using System.Collections.Generic;
namespace TestAeroCalc
{
/// Test de fonctions de différents objets UnitsXMLFile et UnitsCSVFile
[TestFixture]
public class _T_UnitsFile
{
[SetUp]
public void SetUp()
{
}
[Test]
public void saveUnitDictionaryToXML_1()
{
// Création du dictionnaire
UnitsCSVFile uf = new UnitsCSVFile();
Units ud = uf.getUnitsFromCSV(AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + "UnitsDictionary.csv");
List<Unit> lu = ud.getUnits();
Assert.IsTrue(lu.Count > 0);
foreach (Unit u in lu)
{
System.Console.WriteLine(u.ToString());
}
UnitsXMLFile xmlFile = new UnitsXMLFile("");
xmlFile.saveUnitDictionaryToXML(ud, AppDomain.CurrentDomain.BaseDirectory + "TEST-Units.xml");
}
}
}