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

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;
}
主站蜘蛛池模板: 铜山县| 文登市| 宁安市| 定襄县| 鹤山市| 柳江县| 呼图壁县| 紫阳县| 灌云县| 望谟县| 南澳县| 南阳市| 洛南县| 政和县| 和平区| 万全县| 扶沟县| 稻城县| 和顺县| 特克斯县| 镇巴县| 峨山| 晋州市| 普格县| 垦利县| 光泽县| 仙桃市| 乌恰县| 上思县| 广昌县| 寿光市| 龙江县| 巴彦淖尔市| 南木林县| 江都市| 泸水县| 虎林市| 彭泽县| 金阳县| 沅江市| 尉犁县|