admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Quintiq file version 2.0
#parent: #root
Method VerifyPISPAccountSalesCreated (
  MacroPlan macroplan,
  Real timeout,
  Real elapsedtime
) as stream[UTF_UnitTestMPDefaultSalesCostDriver]
{
  Description: 'Verify that pisp accounts are created'
  TextBody:
  [*
    nrofpispaccount := counter( macroplan, Account_MP.AccountAssignment.astype( PISPAccount ), pispacc, 
                                pispacc.CostDriver() = Translations::MP_AccountAssignmentCostDriverSales() );
    ret := emit( this );
    
    if ( nrofpispaccount =0 )
    {
      if( elapsedtime < timeout )
      {
        waitFor := 0.5;   
        wait := stream[Void]::Wait( Duration::Seconds( waitFor ) );
        ret := ret->After( wait )->VerifyPISPAccountSalesCreated( macroplan, timeout, elapsedtime + waitFor ) 
      }
      else 
      {
        this.Run().RegisterFailure( "Expected pisp accounts with sales cost driver are created." );  
      }
    }  
    return ret;
  *]
  InterfaceProperties { Accessibility: 'Module' }
}