官术网_书友最值得收藏!

Pillar 4 – Test runner and test isolation

Goal: Understand what a test runner and its test isolation are and learn how to use and apply them.

Given the previous three pillars, we are positioned to write test cases as follows:

  • Using test codeunit and test functions
  • Either sunny or rainy path, the latter by applying the asserterror keyword
  • With fully automated execution addressing any user interactions by applying handler functions

Do we need more?

As a matter of fact, yes, we do, as we need a way to do the following:

  1. Run tests stored in multiple codeunits, control their execution, and collect and secure the results
  2. Run tests in isolation, so that we can achieve the following:
    • Write transactions, in the end, do not alter the database we run the test on
    • Each rerun of a test is done using the same data setup

Both goals can be accomplished using a so-called TestRunner codeunit with a certain test isolation. A test runner codeunit is defined by its Subtype and the isolation by its TestIsolation:

codeunit Id MyTestRunnerCodeunit
{
Subtype = TestRunner;
TestIsolation = Codeunit;
}
主站蜘蛛池模板: 芒康县| 峨眉山市| 偏关县| 襄樊市| 泗洪县| 南溪县| 克山县| 麻江县| 洪洞县| 巴林右旗| 渑池县| 金川县| 香港 | 广水市| 新安县| 宜兴市| 抚顺市| 安庆市| 通州市| 鄂托克旗| 教育| 舒城县| 鄂托克旗| 绿春县| 六安市| 平湖市| 准格尔旗| 海城市| 弥勒县| 菏泽市| 定兴县| 安化县| 称多县| 寻乌县| 富蕴县| 沛县| 岢岚县| 纳雍县| 鄂托克前旗| 马山县| 大兴区|