Test example 2 – a first positive-negative test
This test example does not relate to a new customer wish and no new application code but is complementary to our first test. It is a rainy path version of the same customer wish leading to a new scenario:
[FEATURE] LookupValue UT Customer [SCENARIO #0002] Assign non-existing lookup value to customer [GIVEN] Non-existing lookup value [GIVEN] Customer [WHEN] Set non-existing lookup value on customer [THEN] Non existing lookup value error thrown
Test code steps
Let's reuse the recipe applied for test example 1.
You might already recall these are the steps to take, being our new tool, the 4-steps recipe:
- Create a test codeunit, with a name based on the FEATURE tag.
- Embed the customer wish into a test function with a name based on the SCENARIO tag.
- Write your test story, based on GIVEN, WHEN, and THEN tags.
- Construct your real code.
Create a test codeunit
Sharing the same FEATURE tag values...