diff --git a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs index 803b7061dd140039bf6a23004fdc7247d97e08c3..1891e8b274546b624ecce8ab8acb7baef0b4b005 100644 --- a/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/JSON/JSONInputData.cs @@ -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); diff --git a/VectoCore/VectoCoreTest/FileIO/JsonTest.cs b/VectoCore/VectoCoreTest/FileIO/JsonTest.cs index d1205edaae76ddfaa015e007976d8b01092273a3..2c75113db6268b751c10204680892358410abe1a 100644 --- a/VectoCore/VectoCoreTest/FileIO/JsonTest.cs +++ b/VectoCore/VectoCoreTest/FileIO/JsonTest.cs @@ -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()); + } + } + } }