| Quintiq file version 2.0 | 
| #parent: #root | 
| Method VerifyData ( | 
|   MacroPlan macroplan | 
| ) | 
| { | 
|   Description: 'Verified imported data as per the export' | 
|   TextBody: | 
|   [* | 
|     ssname := UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::SalesSegmentName(); | 
|     ss := select(  macroplan, SalesSegment_MP, segment, segment.Name() = ssname, true ); | 
|      | 
|     nrofspec := counter( macroplan, SalesSegment_MP.PostponementSpecification, s, true, true ); | 
|     if ( this.Run().AssertEqual( 1, nrofspec, "Found " + [String]nrofspec + " postponement spec, expect 1." ) ) | 
|     { | 
|       nrofrestriction := counter( macroplan, SalesSegment_MP.FulfillmentRestriction, r, true, true ); | 
|       if ( this.Run().AssertEqual( 1, nrofrestriction, "Found " + [String]nrofrestriction + " fulfillment restriction, expect 1." ) ) | 
|       { | 
|         if ( this.Run().AssertNotIsNull( ss, "VerifyData: Sales segment " + ssname + " not found." ) ) | 
|         { | 
|           pps := ss.PostponementSpecification(); | 
|           validspec := pps.HorizonTimeUnit() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::HorizonTimeUnit() | 
|                        and pps.HorizonNrOfTimeUnit() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::HorizonTimeNumber() | 
|                        and pps.MaxNrOfTimeUnit() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::MaxTimeNumber() | 
|                        and pps.MaxTimeUnit() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::MaxTimeUnit(); | 
|            | 
|           if ( this.Run().AssertTrue( validspec,  | 
|                                       "Postponement spec with " | 
|                                       + "SalesSegment " + ssname                               | 
|                                       + ", HorizonTimeUnit " + UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::HorizonTimeUnit() | 
|                                       + ", HorizonNrOfTimeUnit " + [String]UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::HorizonTimeNumber() | 
|                                       + ", MaxNrOfTimeUnit " + [String]UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::MaxTimeNumber() | 
|                                       + ", MaxTimeUnit " + UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::MaxTimeUnit() | 
|                                       + " not found" ) ) | 
|           { | 
|             validrestriction := exists( ss, | 
|                                         FulfillmentRestriction, | 
|                                         r, | 
|                                         r.EndDate() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionEndDate() | 
|                                         and r.StartDate() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionStartDate() | 
|                                         and r.ProductID() = UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionProductID() ); | 
|            | 
|             this.Run().AssertTrue( validrestriction, | 
|                                     "Fulfillment restriction with "                                                             | 
|                                     + "SalesSegment " + ssname                             | 
|                                     + ", EndDate " + [String]UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionEndDate() | 
|                                     + ", StartDate " + [String]UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionStartDate() | 
|                                     + ", ProductID " + UTF_UnitTestMPPostponementSpecAndFulfillmentRestrictionExcelImport::RestrictionProductID() | 
|                                     + " not found" ); | 
|           } | 
|         } | 
|       } | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |