mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-19 04:15:06 +00:00
Add test project for mf cobol.
This commit is contained in:
1 parent
822997c488
commit
43814b8169
4 files changed
+250
No files matched your search
@@ -0,0 +1,67 @@
|
||||
*> Test Fixture for GildedRose, GildedRose
|
||||
|
||||
copy "mfunit_prototypes.cpy".
|
||||
|
||||
program-id. TestGildedRose.
|
||||
|
||||
file-control.
|
||||
select in-items assign 'in-items'.
|
||||
select items assign 'items'.
|
||||
|
||||
file section.
|
||||
fd in-items.
|
||||
01 in-item.
|
||||
02 sell-in pic 9(4).
|
||||
02 quality pic 9(4).
|
||||
02 name pic x(50).
|
||||
fd items.
|
||||
01 item.
|
||||
02 sell-in pic 9(4).
|
||||
02 quality pic 9(4).
|
||||
02 name pic x(50).
|
||||
|
||||
working-storage section.
|
||||
copy "mfunit.cpy".
|
||||
78 TEST-TESTGILDEDROSE value "TestGildedRose".
|
||||
01 pp procedure-pointer.
|
||||
|
||||
*> Program linkage data
|
||||
|
||||
procedure division.
|
||||
goback returning 0
|
||||
.
|
||||
|
||||
entry MFU-TC-PREFIX & TEST-TESTGILDEDROSE.
|
||||
open output in-items
|
||||
move "foo" to name in in-item
|
||||
move 0 to quality in in-item
|
||||
move 0 to sell-in in in-item
|
||||
write in-item
|
||||
close in-items
|
||||
call "GildedRose"
|
||||
open input items
|
||||
read items
|
||||
if name in item not equal to "fixme" then
|
||||
call MFU-ASSERT-FAIL-Z using z"item name was not fixme"
|
||||
close items
|
||||
goback
|
||||
.
|
||||
|
||||
$region TestCase Configuration
|
||||
|
||||
entry MFU-TC-SETUP-PREFIX & TEST-TESTGILDEDROSE.
|
||||
perform InitializeLinkageData
|
||||
*> Add any other test setup code here
|
||||
goback returning 0
|
||||
.
|
||||
|
||||
InitializeLinkageData section.
|
||||
*> Load the library that is being tested
|
||||
set pp to entry "GildedRose"
|
||||
|
||||
exit section
|
||||
.
|
||||
|
||||
$end-region
|
||||
|
||||
end program.
|
||||
Reference in new issue
Block a user