I've just quickly checked Robolectric
shadow classes and FragmentManager
API. And I haven't any method that helps with pending transactions.
So I would suggest you to use Mockito
until there are such methods. For sure Robolectric
usage is preferred over Mockito
because of better code design (no unnecessary injections like in your case FragmentManager
)