diff --git a/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs b/VectoCommon/VectoCommon/InputData/IInputDataProvider.cs index 93ecf752d99bd5bce13efa4947ee231e7c28d936..078d00578c1059fc2d6141271ba6594a84b61404 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 44b0aeeebcb2129dc55f6a8ffd8ba8ca64cb32a8..d53ebe35137ded0c71bb338caefa0c5c8ea39031 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 be78f071e6b119b403e2e5a91c5b060a979654de..78607f20cad8e9d4b82c91e3bee1332d67b4825d 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 1e2a02f6e15b4bff4b7fb471c537bebd79005e4b..3d826534af2baf37f880d92fbe684f5c6d514e88 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 0000000000000000000000000000000000000000..446c3d874c04a3b1ee0f12e008a624f52e47664f --- /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; + + + } + } +}