| Quintiq file version 2.0 | 
| #parent: #root | 
| Method VerifyIncludeExcludeSetupExpectationStockingPoints ( | 
|   MacroPlan macroplan, | 
|   Strings lines, | 
|   Boolean expectedDefaultAllIncluded | 
| ) as owning StockingPoint_MPs | 
| { | 
|   TextBody: | 
|   [* | 
|     // Setup test - what entities expected include or exclude | 
|     linesSP := selectset( lines, Elements, line, line.StartsWith( 'Excluded,SP,' ) or line.StartsWith( 'Included,SP,' ) ); | 
|      | 
|     expectedIncludedStockingPoints := construct( StockingPoint_MPs ); | 
|     expectedExcludedStockingPoints := construct( StockingPoint_MPs ); | 
|     traverse( linesSP, Elements, line ) | 
|     { | 
|       if( line.StartsWith( 'Included,SP,' ) ) | 
|       { | 
|         stockingPointID := line.ReplaceAll( 'Included,SP,', '' ).TrimBoth(); | 
|         expectedIncludedStockingPoints.Add( select( macroplan, StockingPoint_MP, sp, sp.ID() = stockingPointID ) ); | 
|       } | 
|       else | 
|       { | 
|         stockingPointID := line.ReplaceAll( 'Excluded,SP,', '' ).TrimBoth(); | 
|         expectedExcludedStockingPoints.Add( select( macroplan, StockingPoint_MP, sp, sp.ID() = stockingPointID ) );    | 
|       } | 
|     } | 
|      | 
|     expectedStockingPoints := selectset( macroplan, StockingPoint_MP, sp, expectedDefaultAllIncluded ); | 
|      | 
|     expectedStockingPoints := ifexpr( expectedDefaultAllIncluded, | 
|                                       expectedStockingPoints.Difference( expectedExcludedStockingPoints ), | 
|                                       expectedStockingPoints.Add( expectedIncludedStockingPoints ) ); | 
|      | 
|     return &expectedStockingPoints; | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |