diff --git a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterNinjectModule.cs b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterNinjectModule.cs index ac17f620a63ee589befda5eff546ee22e420edcf..1e629a88f58e50529e726191bfa5cac4bc6c0d37 100644 --- a/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterNinjectModule.cs +++ b/VectoCore/VectoCore/InputData/Reader/DataObjectAdapter/DeclarationDataAdapterNinjectModule.cs @@ -180,10 +180,10 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter Bind<IGenericCompletedBusDeclarationDataAdapter>() .To<DeclarationDeclarationDataAdapterGenericCompletedBusDeclaration.Exempted>() .WhenInjectedExactlyInto<DeclarationModeCompletedBusRunDataFactory.Exempted>(); - #endregion + #endregion - #region CompletedBus Specific - Bind<ISpecificCompletedBusDeclarationDataAdapter>() + #region CompletedBus Specific + Bind<ISpecificCompletedBusDeclarationDataAdapter>() .To<DeclarationDataAdapterSpecificCompletedBus.Conventional>() .WhenInjectedExactlyInto<DeclarationModeCompletedBusRunDataFactory.Conventional>(); @@ -278,65 +278,6 @@ namespace TUGraz.VectoCore.InputData.Reader.DataObjectAdapter .WhenInjectedExactlyInto<DeclarationModeSingleBusRunDataFactory.PEV_E_IEPC>(); #endregion - #region Factory - - //Bind<IDeclarationDataAdapterFactory>().ToFactory(() => new CombineArgumentsToNameInstanceProvider( - // new CombineArgumentsToNameInstanceProvider.MethodSettings() { - // combineToNameDelegate = _vehicleStringHelper.CreateName, - // methods = new[] { - // typeof(IDeclarationDataAdapterFactory).GetMethod(nameof(IDeclarationDataAdapterFactory - // .CreateDataAdapter)) - // }, - // skipArguments = 1, - // takeArguments = 1, - // })).InSingletonScope(); - - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.Conventional>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ConventionalVehicle, - // ArchitectureID.UNKNOWN)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_S2>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle, - // ArchitectureID.S2)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_S3>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle, - // ArchitectureID.S3)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_S4>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle, - // ArchitectureID.S4)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_S_IEPC>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.SerialHybridVehicle, - // ArchitectureID.S_IEPC)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_P1>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle, - // ArchitectureID.P1)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_P2>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle, - // ArchitectureID.P2)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_P2_5>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle, - // ArchitectureID.P2_5)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_P3>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle, - // ArchitectureID.P3)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.HEV_P4>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.ParallelHybridVehicle, - // ArchitectureID.P4)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.PEV_E2>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.BatteryElectricVehicle, - // ArchitectureID.E2)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.PEV_E3>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.BatteryElectricVehicle, - // ArchitectureID.E3)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.PEV_E4>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.BatteryElectricVehicle, - // ArchitectureID.E4)); - //Bind<IDeclarationDataAdapter>().To<DeclarationDataAdapterHeavyLorry.PEV_E_IEPC>().Named( - // _vehicleStringHelper.GetName(VehicleCategoryHelper.Lorry, VectoSimulationJobType.BatteryElectricVehicle, - // ArchitectureID.E_IEPC)); - - - - #endregion } #endregion diff --git a/VectoCore/VectoCoreTest/InputData/DeclarationDataAdapterTest/DeclarationDataAdapterTest.cs b/VectoCore/VectoCoreTest/InputData/DeclarationDataAdapterTest/DeclarationDataAdapterTest.cs index 8128c7cfcf12973a09f810d6871b7a538a4c127f..0f31df127c2472e1bd5b74438759d9a22c027af9 100644 --- a/VectoCore/VectoCoreTest/InputData/DeclarationDataAdapterTest/DeclarationDataAdapterTest.cs +++ b/VectoCore/VectoCoreTest/InputData/DeclarationDataAdapterTest/DeclarationDataAdapterTest.cs @@ -27,32 +27,7 @@ namespace TUGraz.VectoCore.Tests.InputData.DeclarationDataAdapterTest } #region LorriesSerialHybridVehicle - [TestCase(VectoSimulationJobType.ConventionalVehicle, ArchitectureID.UNKNOWN, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.Conventional))] - [TestCase(VectoSimulationJobType.SerialHybridVehicle, ArchitectureID.S2, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_S2))] - [TestCase(VectoSimulationJobType.SerialHybridVehicle, ArchitectureID.S3, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_S3))] - [TestCase(VectoSimulationJobType.SerialHybridVehicle, ArchitectureID.S4, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_S4))] - [TestCase(VectoSimulationJobType.SerialHybridVehicle, ArchitectureID.S_IEPC, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_S_IEPC))] - [TestCase(VectoSimulationJobType.ParallelHybridVehicle, ArchitectureID.P1, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_P1))] - [TestCase(VectoSimulationJobType.ParallelHybridVehicle, ArchitectureID.P2, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_P2))] - [TestCase(VectoSimulationJobType.ParallelHybridVehicle, ArchitectureID.P2_5, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_P2_5))] - [TestCase(VectoSimulationJobType.ParallelHybridVehicle, ArchitectureID.P3, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_P3))] - [TestCase(VectoSimulationJobType.ParallelHybridVehicle, ArchitectureID.P4, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.HEV_P4))] - [TestCase(VectoSimulationJobType.BatteryElectricVehicle, ArchitectureID.E2, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.PEV_E2))] - [TestCase(VectoSimulationJobType.BatteryElectricVehicle, ArchitectureID.E3, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.PEV_E3))] - [TestCase(VectoSimulationJobType.BatteryElectricVehicle, ArchitectureID.E4, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.PEV_E4))] - [TestCase(VectoSimulationJobType.BatteryElectricVehicle, ArchitectureID.E_IEPC, VehicleCategoryHelper.Lorry, false, typeof(DeclarationDataAdapterHeavyLorry.PEV_E_IEPC))] - - public void DeclarationDataAdapterFactoryTest(VectoSimulationJobType jobType, ArchitectureID archId, - string vehicleType, bool exempted, Type expectedType) - { - var iepc = false; - var ihpc = false; - var vehicleClassification = - new VehicleTypeAndArchitectureStringHelperRundata.VehicleClassification(jobType, archId, vehicleType, - exempted, iepc, ihpc); - var result =_declarationDataAdapterFactory.CreateDataAdapter(vehicleClassification); - Assert.AreEqual(expectedType, result.GetType()); - } +