Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Unverified Commit a2f5959b authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adding testcase for segment lookup for medium lorries

parent 288e4a9e
Branches
Tags
No related merge requests found
......@@ -1452,6 +1452,21 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration
deltaCdA: 1.5,
maxLoad: 39600,
ems: true);
AssertMission(segment.Missions[4],
vehicleData: vehicleData,
missionType: MissionType.UrbanDelivery,
cosswindCorrection: "TractorSemitrailer",
axleWeightDistribution: new[] { 0.25, 0.25 },
trailerAxleWeightDistribution: new[] { 0.5 },
trailerAxleCount: new[] { 3 },
bodyCurbWeight: 0,
trailerCurbWeight: new[] { 7500.0 },
trailerType: new[] { TrailerType.ST1 },
lowLoad: 2600,
refLoad: 12900,
trailerGrossVehicleWeight: new[] { 24000.0 },
deltaCdA: 0, maxLoad: 25000);
}
/// <summary>
......@@ -2064,6 +2079,116 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration
maxLoad: 24145);
}
/// <summary>
/// Segment 53: medium lorry
/// </summary>
[TestCase]
public void Segment53Test()
{
var vehicleData = new {
VehicleCategory = VehicleCategory.RigidTruck,
AxleConfiguration = AxleConfiguration.AxleConfig_4x2,
GrossVehicleMassRating = 5200.SI<Kilogram>(),
CurbWeight = 1300.SI<Kilogram>()
};
var segment = DeclarationData.TruckSegments.Lookup(vehicleData.VehicleCategory, vehicleData.AxleConfiguration,
vehicleData.GrossVehicleMassRating, vehicleData.CurbWeight, false);
Assert.AreEqual(VehicleClass.Class53, segment.VehicleClass);
var data = AccelerationCurveReader.ReadFromStream(segment.AccelerationFile);
TestAcceleration(data);
Assert.AreEqual(2, segment.Missions.Length);
AssertMission(segment.Missions[0],
vehicleData: vehicleData,
missionType: MissionType.RegionalDelivery,
cosswindCorrection: "MediumLorriesRigid",
axleWeightDistribution: new[] { 0.45, 0.55 },
trailerAxleWeightDistribution: new double[] { },
trailerAxleCount: new int[] { },
bodyCurbWeight: 800,
trailerCurbWeight: new double[] { },
trailerType: new TrailerType[] { },
lowLoad: 149.743589,
refLoad: 764.3589743,
trailerGrossVehicleWeight: new double[] { },
deltaCdA: 0,
maxLoad: 3100);
AssertMission(segment.Missions[1],
vehicleData: vehicleData,
missionType: MissionType.UrbanDelivery,
cosswindCorrection: "MediumLorriesRigid",
axleWeightDistribution: new[] { 0.45, 0.55 },
trailerAxleWeightDistribution: new double[] { },
trailerAxleCount: new int[] { },
bodyCurbWeight: 800,
trailerCurbWeight: new double[] { },
trailerType: new TrailerType[] { },
lowLoad: 149.743589,
refLoad: 764.3589743,
trailerGrossVehicleWeight: new double[] { },
deltaCdA: 0,
maxLoad: 3100);
}
/// <summary>
/// Segment 54: medium lorry
/// </summary>
[TestCase]
public void Segment54Test()
{
var vehicleData = new {
VehicleCategory = VehicleCategory.Van,
AxleConfiguration = AxleConfiguration.AxleConfig_4x2,
GrossVehicleMassRating = 5200.SI<Kilogram>(),
CurbWeight = 1300.SI<Kilogram>()
};
var segment = DeclarationData.TruckSegments.Lookup(vehicleData.VehicleCategory, vehicleData.AxleConfiguration,
vehicleData.GrossVehicleMassRating, vehicleData.CurbWeight, false);
Assert.AreEqual(VehicleClass.Class54, segment.VehicleClass);
var data = AccelerationCurveReader.ReadFromStream(segment.AccelerationFile);
TestAcceleration(data);
Assert.AreEqual(2, segment.Missions.Length);
AssertMission(segment.Missions[0],
vehicleData: vehicleData,
missionType: MissionType.RegionalDelivery,
cosswindCorrection: "MediumLorriesVan",
axleWeightDistribution: new[] { 0.45, 0.55 },
trailerAxleWeightDistribution: new double[] { },
trailerAxleCount: new int[] { },
bodyCurbWeight: 0,
trailerCurbWeight: new double[] { },
trailerType: new TrailerType[] { },
lowLoad: 149.743589,
refLoad: 764.3589743,
trailerGrossVehicleWeight: new double[] { },
deltaCdA: 0,
maxLoad: 3900);
AssertMission(segment.Missions[1],
vehicleData: vehicleData,
missionType: MissionType.UrbanDelivery,
cosswindCorrection: "MediumLorriesVan",
axleWeightDistribution: new[] { 0.45, 0.55 },
trailerAxleWeightDistribution: new double[] { },
trailerAxleCount: new int[] { },
bodyCurbWeight: 0,
trailerCurbWeight: new double[] { },
trailerType: new TrailerType[] { },
lowLoad: 149.743589,
refLoad: 764.3589743,
trailerGrossVehicleWeight: new double[] { },
deltaCdA: 0,
maxLoad: 3900);
}
public static void AssertMission(Mission m, dynamic vehicleData, MissionType missionType, string cosswindCorrection,
double[] axleWeightDistribution, double[] trailerAxleWeightDistribution, int[] trailerAxleCount,
double bodyCurbWeight, double[] trailerCurbWeight, TrailerType[] trailerType, double lowLoad, double refLoad,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment