Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f1029c86 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

add test to check techlist for json input data

parent 79a0cf31
No related branches found
No related tags found
Loading
......@@ -30,6 +30,7 @@
*/
using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
......@@ -152,6 +153,22 @@ namespace TUGraz.VectoCore.Tests.FileIO
() => { var tmp = new JSONInputDataV2(json, TestJobFile).DriverInputData.OverSpeedEcoRoll; },
"Key OverSpeedEcoRoll not found");
}
[TestMethod]
public void TestReadingElectricTechlist()
{
var json = (JObject)JToken.ReadFrom(new JsonTextReader(File.OpenText(TestJobFile)));
((JArray)json["Body"]["Aux"][3]["TechList"]).Add("LED lights");
var job = new JSONInputDataV2(json, TestJobFile);
foreach (var aux in job.Auxiliaries) {
if (aux.ID == "ES") {
Assert.AreEqual(1, aux.TechList.Count);
Assert.AreEqual("LED lights", aux.TechList.First());
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment