Posted: 15 Nov 2018 21:55 EST Last activity: 26 Nov 2018 0:34 EST
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 ?
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.