Extension Test Framework

文件资料 •
在此文中

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.
     

 

 

请帮助我们完善必备文件

我们非常欢迎您发送宝贵的反馈意见

请告诉我们什么主题需要更好的解释或如何才能更好的对其诠释。

分享这篇文章: Twitter | Facebook | LinkedIn | Email