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

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

make gearbox test work

parent 161d55f9
No related branches found
No related tags found
No related merge requests found
......@@ -47,12 +47,12 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData
var gbxData = GearboxData.ReadFromFile(TestContext.DataRow["GearboxDataFile"].ToString());
var angSpeed = SpeedToAngularSpeed(speed, rdyn) * gbxData.AxleGearData.Ratio;
var PvD = Double.Parse(TestContext.DataRow["PowerGbxOut"].ToString(), CultureInfo.InvariantCulture).SI<Watt>();
var torqueToWheels = Formulas.PowerToTorque(PvD, angSpeed);
var torqueToWheels = Formulas.PowerToTorque(PvD, SpeedToAngularSpeed(speed, rdyn));
var torqueFromEngine = 0.SI<NewtonMeter>();
var angSpeed = SpeedToAngularSpeed(speed, rdyn) * gbxData.AxleGearData.Ratio;
if (TestContext.DataRow["Gear"].ToString() == "A") {
torqueFromEngine = gbxData.AxleGearData.LossMap.GearboxInTorque(angSpeed, torqueToWheels);
}
......@@ -81,7 +81,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData
gbxData.AxleGearData.LossMap.GearboxInTorque(angSpeed, torqueToWheels);
Assert.Fail("angular Speed too high");
} catch (Exception e) {
Assert.IsInstanceOfType(e, typeof (VectoSimulationException));
Assert.IsInstanceOfType(e, typeof (VectoSimulationException), "angular speed too high");
}
angSpeed = 1000.RPMtoRad();
......@@ -90,16 +90,16 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData
gbxData.AxleGearData.LossMap.GearboxInTorque(angSpeed, torqueToWheels);
Assert.Fail("torque too high");
} catch (Exception e) {
Assert.IsInstanceOfType(e, typeof (VectoSimulationException));
Assert.IsInstanceOfType(e, typeof (VectoSimulationException), "torque too high");
}
angSpeed = 1000.RPMtoRad();
torqueToWheels = -5000.SI<NewtonMeter>();
torqueToWheels = -10000.SI<NewtonMeter>();
try {
gbxData.AxleGearData.LossMap.GearboxInTorque(angSpeed, torqueToWheels);
Assert.Fail("torque too low");
} catch (Exception e) {
Assert.IsInstanceOfType(e, typeof (VectoSimulationException));
Assert.IsInstanceOfType(e, typeof (VectoSimulationException), "torque too low");
}
angSpeed = -1000.RPMtoRad();
......@@ -108,7 +108,7 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponentData
gbxData.AxleGearData.LossMap.GearboxInTorque(angSpeed, torqueToWheels);
Assert.Fail("negative angular speed");
} catch (Exception e) {
Assert.IsInstanceOfType(e, typeof (VectoSimulationException));
Assert.IsInstanceOfType(e, typeof (VectoSimulationException), "negative angular speed");
}
}
......
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