Skip to content

Mock a batch file READ and provide a fake record

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

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

       TESTSUITE 'Batch program handles input record correctly' 

       TESTCASE 'Verify processing given a known input record' 
           MOCK INPUT-FILE
               ON OPEN
                   MOVE STATUS-OK TO FILE-STATUS
               ON READ 
                   SET END-OF-FILE TO FALSE 
                   MOVE 'THIS IS MY FAKE INPUT RECORD' TO INPUT-AREA
           END-MOCK
           PERFORM PARAGRAPH-UNDER-TEST
           EXPECT WS-FOO TO BE 'BAR'
Clone this wiki locally