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

Skip to content
Snippets Groups Projects
Commit 9479fa31 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

set correct validation context in testcase

parent 673af51c
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.InputData;
using TUGraz.VectoCommon.Models;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.InputData.FileIO.JSON;
......@@ -180,9 +181,14 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
var runData = new VectoRunData {
EngineData = engineData,
AxleGearData = axleGearData,
Cycle = new DrivingCycleData { Entries = new List<DrivingCycleData.DrivingCycleEntry>() }
Cycle = new DrivingCycleData { Entries = new List<DrivingCycleData.DrivingCycleEntry>() },
JobType = VectoSimulationJobType.EngineOnlySimulation
};
var result = VectoRunData.ValidateRunData(runData, new ValidationContext(runData));
var context = new ValidationContext(runData);
context.ServiceContainer.AddService(typeof(VectoValidationModeServiceContainer),
new VectoValidationModeServiceContainer(ExecutionMode.Declaration, VectoSimulationJobType.EngineOnlySimulation, PowertrainPosition.HybridPositionNotSet, GearboxType.AMT, false));
var result = VectoRunData.ValidateRunData(runData, context);
Assert.IsTrue(ValidationResult.Success == result);
Assert.IsFalse(runData.IsValid());
}
......
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