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

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

adapt pt1 test to new lookup structure

parent 0f5fad87
No related branches found
No related tags found
No related merge requests found
......@@ -96,20 +96,22 @@ namespace TUGraz.VectoCore.Tests.Models.Declaration
TestCase(1775, 0.21),
TestCase(1900, 0.155),
TestCase(2250, 0.11),
// extrapolate
TestCase(3000, 0.11),
]
public void PT1Test(double rpm, double expectedPt1)
{
Assert.AreEqual(expectedPt1, DeclarationData.PT1.Lookup(rpm.RPMtoRad()).Value.Value(), Tolerance);
var pt1 = DeclarationData.PT1.Lookup(rpm.RPMtoRad());
Assert.AreEqual(expectedPt1, pt1.Value.Value(), Tolerance);
Assert.IsFalse(pt1.Extrapolated);
}
[TestCase]
public void PT1ExceptionsTest()
[TestCase(200),
TestCase(0),
TestCase(3000, 0.11),]
public void PT1ExceptionsTest(double rpm)
{
// EXTRAPOLATE
AssertHelper.Exception<VectoException>(() => DeclarationData.PT1.Lookup(200.RPMtoRad()));
AssertHelper.Exception<VectoException>(() => DeclarationData.PT1.Lookup(0.RPMtoRad()));
var tmp = DeclarationData.PT1.Lookup(rpm.RPMtoRad());
Assert.IsTrue(tmp.Extrapolated);
}
[TestCase]
......
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