Designing tests with ATDD

In his book, Automated Testing in Microsoft Dynamics 365 Business Central, Luc van Vugt delves into how to design and implement your tests. Based on the so-called Acceptance Test-Driven Development (ATDD) methodology, he shows how to write your requirements like a test design using the ATDD pattern. This pattern introduces five tags:

  • FEATURE: Defines what feature(s) the test or collection of test cases is testing.
  • SCENARIO: Defines the scenario being tested for a single test.
  • GIVEN: Defines what data setup is needed; a test case can have multiple GIVEN tags when the data setup is more complex.
  • WHEN: Defines the action under test; each test case should have only one WHEN tag.
  • THEN: Defines the result of the action, or more specifically, the verification of the result. If multiple results apply, multiple THEN tags will be needed.

The following is what a ATDD scenario would look like for our customer category feature:

  • [FEATURE] Customer Category
  • [SCENARIO #0002] Assign blocked customer category to customer
  • [GIVEN] A blocked customer category
  • [GIVEN] A customer
  • [WHEN] Set customer category on customer
  • [THEN] Blocked category error thrown

After learning how to design, we will now look at how to prepare the environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.25.32