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

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;
}
主站蜘蛛池模板: 平乡县| 略阳县| 扬中市| 苍溪县| 上思县| 花垣县| 景谷| 迁安市| 任丘市| 鸡东县| 盐池县| 黄大仙区| 天峻县| 高雄市| 呼和浩特市| 岫岩| 金沙县| 封丘县| 咸阳市| 玉溪市| 丰城市| 芷江| 顺昌县| 呼图壁县| 湘乡市| 泽库县| 汤原县| 文登市| 山丹县| 三亚市| 黄大仙区| 舒兰市| 简阳市| 密云县| 兰坪| 抚顺县| 安吉县| 安岳县| 郴州市| 资阳市| 荆门市|