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

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;
}
主站蜘蛛池模板: 和田县| 宁波市| 达州市| 鹤峰县| 元江| 大同市| 辽宁省| 灌南县| 宁明县| 湘乡市| 金溪县| 固安县| 乌恰县| 永平县| 郯城县| 海淀区| 永登县| 罗山县| 兴仁县| 瓦房店市| 同仁县| 东乌珠穆沁旗| 沛县| 德令哈市| 台江县| 台南县| 新乡县| 平安县| 海城市| 无极县| 松原市| 沅陵县| 玉门市| 遵化市| 余江县| 临高县| 上杭县| 沐川县| 山丹县| 天津市| 诏安县|