From a3a39ae79ffa54f9320da3d3cfaa71f62c445a1d Mon Sep 17 00:00:00 2001 From: "VKMTHD\\franzjosefkober" <franz.josef.kober@ivt.tugraz.at> Date: Wed, 10 Mar 2021 14:30:05 +0100 Subject: [PATCH] added multistage bus data test --- .../InputData/IInputDataProvider.cs | 9 ++++ .../IXMLDeclarationInputDataReader.cs | 6 +++ .../Interfaces/IXMLDeclarationInputData.cs | 6 +++ VectoCore/VectoCoreTest/VectoCoreTest.csproj | 3 +- .../XML/XMLMultistageBusDataTest.cs | 43 +++++++++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 VectoCore/VectoCoreTest/XML/XMLMultistageBusDataTest.cs diff --git a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs index 93ecf752d9..078d00578c 100644 --- a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs +++ b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs @@ -29,6 +29,8 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System.Collections; +using System.Collections.Generic; using System.Xml.Linq; using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Utils; @@ -84,4 +86,11 @@ namespace TUGraz.VectoCommon.InputData IVehicleDeclarationInputData CompletedVehicle { get; } } + + public interface IMultistageBusInputDataProvider : IInputDataProvider + { + IPrimaryVehicleInformationInputDataProvider PrimaryVehicle { get; } + + IList<IManufacturingStageInputData> ManufacturingStage { get; } + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs index 44b0aeeebc..d53ebe3513 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/IXMLDeclarationInputDataReader.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Xml; using TUGraz.VectoCommon.InputData; @@ -16,4 +17,9 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration IApplicationInformation ApplicationInformation { get; } } + + public interface IXMLDeclarationMultistageVehicleBusInputDataReader : IXMLDeclarationPrimaryVehicleBusInputDataReader + { + IList<IManufacturingStageInputData> ManufacturingStageInputData { get; } + } } diff --git a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Interfaces/IXMLDeclarationInputData.cs b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Interfaces/IXMLDeclarationInputData.cs index be78f071e6..78607f20ca 100644 --- a/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Interfaces/IXMLDeclarationInputData.cs +++ b/VectoCore/VectoCore/InputData/FileIO/XML/Declaration/Interfaces/IXMLDeclarationInputData.cs @@ -18,4 +18,10 @@ namespace TUGraz.VectoCore.InputData.FileIO.XML.Declaration.Interfaces XmlNode ApplicationInformationNode { get; } } + + public interface IXMLMultistageVehicleBusInputData : IMultistageBusInputDataProvider, IXMLResource + { + IXMLPrimaryVehicleBusInputData PrimaryVehicleInputData { get; } + IXMLDeclarationMultistageVehicleBusInputDataReader MultistageVehicleInputData { get; } + } } diff --git a/VectoCore/VectoCoreTest/VectoCoreTest.csproj b/VectoCore/VectoCoreTest/VectoCoreTest.csproj index 1e2a02f6e1..3d826534af 100644 --- a/VectoCore/VectoCoreTest/VectoCoreTest.csproj +++ b/VectoCore/VectoCoreTest/VectoCoreTest.csproj @@ -231,7 +231,8 @@ <Compile Include="XML\XMLDeclarationReaderVersionsTest.cs" /> <Compile Include="XML\XMLEngineeringInputRefTest.cs" /> <Compile Include="XML\XMLEngineeringInputSingleTest.cs" /> - <Compile Include="XML\XMLMultistageBusInputTest.cs" /> + <Compile Include="XML\XMLMultistageBusDataTest.cs" /> + <Compile Include="XML\XMLMultistageBusInputDataTest.cs" /> <Compile Include="XML\XMLPrimaryBusInputDataTest.cs" /> <Compile Include="XML\XMLReportTest.cs" /> <Compile Include="XML\XMLPrimaryVehicleReportBusReaderTest.cs" /> diff --git a/VectoCore/VectoCoreTest/XML/XMLMultistageBusDataTest.cs b/VectoCore/VectoCoreTest/XML/XMLMultistageBusDataTest.cs new file mode 100644 index 0000000000..446c3d874c --- /dev/null +++ b/VectoCore/VectoCoreTest/XML/XMLMultistageBusDataTest.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml; +using Ninject; +using NUnit.Framework; +using TUGraz.VectoCommon.InputData; +using TUGraz.VectoCore.InputData.FileIO.XML; + +namespace TUGraz.VectoCore.Tests.XML +{ + public class XMLMultistageBusDataTest + { + protected IXMLInputDataReader xmlInputReader; + private IKernel _kernel; + + const string VIF = + @"TestData\XML\XMLReaderDeclaration\SchemaVersionMultistage.0.1\vecto_multistage_primary_vehicle_stage_2_full.xml"; + + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); + + _kernel = new StandardKernel(new VectoNinjectModule()); + xmlInputReader = _kernel.Get<IXMLInputDataReader>(); + } + + + [TestCase] + public void TestVehicleMultistageBustInput() + { + var reader = XmlReader.Create(VIF); + var inputDataProvider = xmlInputReader.Create(reader) as IMultistageBusInputDataProvider; + var vehicle = inputDataProvider.PrimaryVehicle.ApplicationInformation; + + + } + } +} -- GitLab