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

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

Merge branch 'develop' of...

Merge branch 'develop' of https://webgate.ec.europa.eu/CITnet/stash/scm/~emquarima/vecto-sim into feature/VECTO-238-look-ahead-coasting

Conflicts:
	VECTOAux/VectoAuxiliaries/Electrics/ElectricalConsumerList.vb
	VectoCore/VectoCore/Utils/VectoCSVFile.cs
parents fddaae25 724273d9
No related branches found
No related tags found
No related merge requests found
......@@ -531,6 +531,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
Type = aux.GetEx<string>("Type"),
Technology = aux.GetEx<string>("Technology")
};
if (aux["TechList"] != null) {
auxData.TechList = aux["TechList"].Select(x => x.ToString()).ToList(); // .Select(x => x.ToString).ToArray();
}
var auxFile = aux["Path"];
retVal.Add(auxData);
......
......@@ -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