Extension Test Framework

Documentatie •
In dit artikel

When developing extension we strongly encourage to use the test functionalities and add testcase to you project so that when making change you can see if there have been regressions.

How tests works

The test framework operates similar as a typical testunit.  
For example if you need to test an accounting report.

  • Preparing the test:
    • You create a test case in the sub-directory your extension (see extension package and project).
    • For the report case in the test directory you will put a the accounting file with the data that is necessary for the test. 
    • You create a expected results directory.
      In our case it will contain the expected report. 
      The first time you run a test, you will copy the results to the expected directory. 
    • You write a test function that load the accounting data and call the extension function that generate a report. 
      The first time you run a test, you will check manually that the report is correct. 
       
  • Running the test.
    • You start the test. 
      • The framework will run the test case.
      • The result will be compared to the expected result and if the result is different the test will fail.

Documentation and examples

  • Banana.Test 
    Class used when creating unit tests.
  • How to for the Test Framework
    Step-by-step guide for creating a simple test case example that uses Extensions Test Framework to run unit tests of Extensions.
     

 

 

Tell us how we can help you better
If the information on this page is not what you're looking for, is not clear enough, or is not up-to-date, let us know.

Share this article: Twitter | Facebook | LinkedIn | Email