Question
2
Replies
71
Views
Posted: September 9, 2020
Last activity: September 17, 2020
Test Case for a Data Transform
Hi all
I have created a very simple Data Transform that sets the value of a parameter to true.
Can someone advise how I would create a test case to confirm the parameter is being set please?
Thanks.
***Edited by Moderator: Pallavi to update platform capability tags***
@JillH316
The easiest way to build assertions in a PegaUnit Test Case is to assert values on the primary page of the rule under test. So, try this:
A similar approach can be taken to implement PegaUnit test cases on Function rules. Implement a wrapper rule to call it, post the return value to the wrapper rule's Primary page and implement the PegaUnit test cases on the wrapper rule.
Implement Wrapper rules in the same Test ruleset as your Test Cases, as these rules will never run in Production and only be invoked as part of executing test cases.
Consider also whether it would be reasonable to design your Data Transform so that it sets the 'result' to the clipboard instead of to the Parameter Page. This is a more natural usage of Pega and would make 'D' testable without a wrapper.