Quintiq file version 2.0
|
#parent: #root
|
Method VerifyNoSanityCheckFor (
|
MacroPlan macroplan,
|
String expectedSanityCheckGroupName,
|
String expectedInstance,
|
String expectedSanityCheckDescription
|
)
|
{
|
TextBody:
|
[*
|
SanityCheckGroup::DoSanityCheck( macroplan ); // Refresh sanity check message
|
sanityCheckGroup := select( macroplan, SanityCheckGroup, g, g.Group() = expectedSanityCheckGroupName );
|
|
// Ensure sanity check group exists before checking for the specific sanity check message
|
if( isnull( sanityCheckGroup ) )
|
{
|
this.Run().RegisterFailure( 'Verify sanity check fail. Sanity check group "' + expectedSanityCheckGroupName + '" not found.' + String::NewLine() +
|
'Object = ' + expectedInstance + String::NewLine() +
|
'Description = ' + expectedSanityCheckDescription );
|
}
|
else
|
{
|
// Check if sanity check message contains the PARTIAL expected text (not exact match as sanity check message prefix with more details such as object type involved)
|
// Also checks the message contains the object type (e.g PISP name, unit name, etc)
|
sanityCheckExists := exists( sanityCheckGroup, SanityCheckMessage, m, not m.IsValid() // SanityCheckMessage that is resolved by user still exist, thus we check this boolean
|
and m.Description() ~ expectedInstance
|
and m.Description() ~ expectedSanityCheckDescription );
|
|
this.Run().AssertFalse( sanityCheckExists, 'Verify sanity check fail. Has sanity check but expected not for "' + expectedSanityCheckDescription + '".' + String::NewLine() +
|
'Group = ' + expectedSanityCheckGroupName + String::NewLine() +
|
'Object = ' + expectedInstance );
|
}
|
*]
|
InterfaceProperties { Accessibility: 'Module' }
|
}
|