Skip to content

Mock a batch file OPEN and provide a fake STATUS CODE

Dave Nicolette edited this page Feb 4, 2021 · 4 revisions

Home -> User Guide -> Common Test Case Patterns ->

       TESTSUITE 'Batch program handles file not found condition correctly' 

       TESTCASE 'Verify processing when input file is not found' 
           MOCK INPUT-FILE
               ON OPEN
                   MOVE STATUS-FILE-NOT-FOUND TO FILE-STATUS
           END-MOCK
           PERFORM PARAGRAPH-UNDER-TEST
           EXPECT WS-ERROR-MESSAGE TO BE 'FILE INPUT-FILE NOT FOUND'
Clone this wiki locally