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

Standard tests

Goal: Get to know the basics of the standard tests provided by Microsoft.

Ever since NAV 2016, Microsoft made their own application test collateral a part of the product. A humongous set of tests is delivered as a .fob file on the product DVD, in the TestToolKit folder, and in the Docker images. Indeed, the tests haven't been delivered as an extension yet.

The standard test suite does contain mainly test codeunits. But there are also a number of supporting table, page, report, and XMLport objects in the .fob file.

For Dynamics 365 Business Central, the whole set contains almost 23,000 tests in more than 700 test codeunits, for w1 and local functionality for each country in which Microsoft releases. And with every bug that's fixed and with every new feature introduced in the application, the number of tests is growing. It has been built over the last ten years and it covers all functional areas of Business Central.

Let's set up a new suite in the Test Tool called ALL W1:

  1. Click on the Assist Edit button in the Suite Name control
  2. In the CAL Test Suites pop-up window select New
  3. Populate the Name and Description fields
  4. Click OK

To open the newly created test suite:

Now, using the Get Test Codeunits action, let Business Central fetch all standard test codeunits as shown in the next screenshot. Note that I did remove our test codeunit 60000 through 60003:

Reading the names of all test codeunits will give you a first impression of what they entail, which are as follows:

  • Enterprise Resource Management (ERM) and Supply Chain Management (SCM) codeunits:
    • These two categories contain almost 450 codeunits to form the major part of standard test collateral
    • ERM test codeunits cover G/L, sales, purchase, and inventory
    • SCM test codeunits cover warehouse and production
  • Apart from ERM and SCM, several other categories can be noted, of which the biggest are:
    • Service (approximately 50 test codeunits)
    • O365 integration (approximately 35)
    • Job (approximately 25)
    • Marketing (approximately 15)

Most of these test codeunits contain functional, end-to-end tests. But there are also codeunits that hold unit tests (UT). These are marked by the addition of Unit Test to their name. Some examples are as follows:

  • Codeunit 134155 - ERM Table Fields UT
  • Codeunit 134164 - Company Init UT II
  • Codeunit 134825 - UT Customer Table

With headless testing being the initial trigger for bringing the testability framework into the platform, it's no surprise that the clear majority of standard test codeunits comprises headless tests. Test codeunits that are meant to test the user interface (UI) are marked using UI or UX in their name. Some examples are as follows:

  • Codeunit 134280 - Simple Data Exchange UI UT
  • Codeunit 134339 - UI Workflow Factboxes
  • Codeunit 134711 - Autom. Payment Registration.UX
  • Codeunit 134927 - ERM Budget UI

Note that these are not the only test codeunits addressing the UI. Any other might contain one or more UI tests, where, in general, the bulk will be headless tests.

As I am often asked how to test reports, it is noteworthy to mention as a last category those test codeunits that are dedicated to testing reports. Search for any test codeunit that is marked with the word Report in its name. You will find 50+ of them. The following are a couple of examples:

  • Codeunit 134063 - ERM Intrastat Reports
  • Codeunit 136311 - Job Reports II
  • Codeunit 137351 - SCM Inventory Reports – IV
主站蜘蛛池模板: 甘肃省| 惠东县| 遂平县| 黄梅县| 馆陶县| 泸西县| 阳城县| 达拉特旗| 寿宁县| 长汀县| 台州市| 鲁山县| 巴东县| 黄平县| 锡林郭勒盟| 陕西省| 大港区| 锡林浩特市| 大余县| 南木林县| 辽源市| 建宁县| 河曲县| 南开区| 定边县| 新蔡县| 奉贤区| 台东市| 江安县| 阳江市| 东平县| 桐乡市| 广河县| 巩义市| 原阳县| 黔东| 阿坝县| 湖口县| 石嘴山市| 罗源县| 盐津县|