Writing the test story

Writing the first black parts is about writing pseudo-English, defining what needs to be achieved with a test. It makes a test readable by any non-technical peer in the project, and in the event their support is needed, the threshold for them to read the test is substantially lower than if the code had been written as technical code. And, maybe an even stronger argument is that the code will be embedded in reusable helper functions.

So, here we go; let's write the black parts:

codeunit 60100 "Customer Category PKT"
{
// [FEATURE] Customer Category
SubType = Test;
[Test]
procedure AssignNonBlockedCustomerCategoryToCustomer()
begin
// [SCENARIO #0001] Assign non-blocked customer category
// to customer
// [GIVEN] A non-blocked customer category
CreateNonBlockedCustomerCategory();
// [GIVEN] A customer
CreateCustomer();
// [WHEN] Set customer category on customer
SetCustomerCategoryOnCustomer();
// [THEN] Customer category on customer
VerifyCustomerCategoryOnCustomer();
end;
}

This story sets up four helper functions in which the content will be constructed in the next step. Note how close the names of the helper functions are to the descriptions of the tags that they belong to, and that no arguments or return values have been defined yet.

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

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