Poor design indicator

If it's hard for you to write a test, it is not a problem of a test framework. Complex test - a sign that the design of the system has problems.

There are moments when you have to exert every effort to write test for the next function. You start to write the test and the code grows to unprecedented size. Or you came to standstill because you do not know how to write a mock class or stub method. And here we start to conjure and due to miracles of ingenuity the code becomes ugly. And nobody can understand what is happening in the test.

If you're in that situation, then you need to stop. Take your hands from the keyboard and look at your system. Perphaps you should change inheritance with composition? Perhaps your function takes on too many responsibilities? Or maybe you have too many dependencies? Think, what prevents you write a simple test?

As a story about a frog and the pot; if you throw a frog in a pot of boiling water, it will immediately jump out from there. If there are cold water in the boiler and it will warm up gradually, the frog will cook.

Tests allow you to feel the moment when the design of the system begins to complicate and when you should jump out of the boiler.