Documentation‎ > ‎1 min. tutorial‎ > ‎

1 min. tutorial (2/3)

 << Previous  Next >>

Describe test strategy

We want to test that when the country of origin is France and destination country is Italy then delivery taxes are set to 120€.
The easiest way to describe strategy test is to create a COBOLUnit description  file (CBUBATCH.DAT) in which we are going to:

1-  Set the Suite name to "SUITE-DELIVERY-COST"
     Add the suite using <ADDSUITE> tag
2- Create a new test named "FRANCE-TO-ITALY"
The routine name of this test is TS000011.   
    Add it to previous declared suite using <ADDTEST> tag
3- Ask COBOLUnit to run tests suite with the <RUN> tag

    <SETDESC> Tests Suite for delivery costs
       * Add a test
       <SETPROG> TS000011
       <SETDESC> IF FROM='FR' and TO='IT' then TAXES=120€

"CBUP0005" from CBU library scan directory to find CBUBATCH.dat and set CBU properties according to tests suite description.
Now let's run our test calling CBUP0005. The tests result is stored in CBUPRINT.DAT file:

Starting the 'Test Execution' Phase
^@|--- | TEST ' FRANCE-TO-ITALY ' Running
^@|    |==> Test ' FRANCE-TO-ITALY ' * FAILURE * ( 000000000 Assertions, 000000000 Failures, 1 errors).
^@|==> SUITE ' SUITE-DELIVERY-COST ' FAILURE ( 000000000 test cases, 000000000 success, 000000000 failures, 000000001 errors )

The suite failed with one error because COBOLUnit did not find the test code TS000011 declared in CBUBATCH.DAT

Next step is to write the test code.

 << Previous Next >>