Quintiq file version 2.0
|
#parent: #root
|
Method VerifyKPIFulfillment (
|
MacroPlan macroplan,
|
Real expectedValue,
|
Real timeoutInSeconds,
|
Real elapsedInSeconds
|
) as stream[UTF_UnitTestMPBase]
|
{
|
TextBody:
|
[*
|
actual := macroplan.GetKPIFulfillment().Round( 0 );
|
uom := macroplan.DefaultUnitOfMeasure().Name()
|
kpiMatch := actual = expectedValue;
|
|
ret := emit( this );
|
|
if( not kpiMatch )
|
{
|
if( elapsedInSeconds < timeoutInSeconds )
|
{
|
waitFor := 0.5;
|
wait := stream[Void]::Wait( Duration::Seconds( waitFor ) );
|
ret := ret->After( wait )->VerifyKPIFulfillment( macroplan, expectedValue, timeoutInSeconds, elapsedInSeconds + waitFor );
|
}
|
else
|
{
|
this.Run().RegisterFailure( 'Expected KPI value for fulfillment is ' + [String]expectedValue + ' ' + uom + ' but actual value is ' + [String]actual + ' ' + uom);
|
}
|
}
|
|
return ret;
|
*]
|
InterfaceProperties { Accessibility: 'Module' }
|
}
|