Question
1
Replies
45
Views
MPhasis
Posted: November 15, 2018
Last activity: November 26, 2018
Closed
How can we write a PegaUnit assertion based on Activity status
Hello PDN Community Members,
I am writing PegaUnit cases came across below scenario.
How can we write a PegaUnit assertion based on Activity status.
For Ex, I have Activity A calls sub activity B which does some DB save operation.
In activity A i have logic to check status(StepStatusFail) of the sub activity.
How can we write the assertion in PegaUnit case for Activity A to validate step status of the sub activity ?
Thanks.
In your scenario, it might be better off to unit test sub activity B and all its permutations both positive and negative. Then test Activity A to cover its scenarios, although it might be challenging to trigger a negative scenario that will result in StepStatusFail without some form of mocking or creating a test stub of sub activity B. Support for this type of stubbing is planned for a future release.